Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > Simple Question *Probably*


Reply
 
Thread Tools Display Modes
  #1  
Old 11-13-2003, 11:42 AM
Mystical Mystical is offline
Junior Contributor
 
Join Date: Aug 2003
Posts: 306
Default Simple Question *Probably*


I have 53 checkboxes that I made into a control array. I am using this for part of a website url that i have stored as a string.

Each checkbox represents a number eg... check1(1) = 2 check3(3) = 6 so forth I already coded this part.
What I want to do is when the person click say checkbox(37) and clicks enter the Url String will be
www.website.com/destination=checkbox(37).php
I have it where only 1 checkbox can be clicked.
How would I do this? eg

Private Sub cmdClick()
URL = "www.website.com"
strDestination = "destination=" & What do I add here to make it use the checkbox checked?
Headers = Blah Blah Blah
inet.execute URL, "GET", strDestination, Headers

It probably possible to add 53 If Thens to get this to work but weren't control arrays to help you not do it that way and save time?
Reply With Quote
  #2  
Old 11-13-2003, 11:53 AM
FireXtol FireXtol is offline
Centurion
 
Join Date: Nov 2003
Posts: 149
Default

Code:
For X = checkbox.lbound to checkbox.ubound If checkbox(x).value = 1 then 'do something Exit For ' don't loop anymore End If Next X
__________________
FireXtol
VB6, C++, HTML, Iptscrae

Last edited by FireXtol; 11-13-2003 at 01:06 PM.
Reply With Quote
  #3  
Old 11-13-2003, 12:01 PM
PlenoJure's Avatar
PlenoJure PlenoJure is offline
'With Full Right'

Retired Moderator
* Guru *
 
Join Date: Jun 2003
Posts: 1,880
Default

The one way to do this would be to set up a variable to hold the name of the last check box the was checked. Declare a variable in the Declarations area of your form and in the Click event of checkbox set the value of the variable to the name of the checkbox. Something like this:

Code:
Private Sub Check1_Click(Index As Integer) lngLastChecked = Index End Sub Private Sub cmdClick() URL = "www.website.com" strDestination = "destination=checkbox(" & lngLastChecked & ").php" Headers = "" inet.execute URL, "GET", strDestination, Headers End Sub

BTW, since you only want one checked at a time you might want to use OptionButtons instead..
__________________
Adam
-- Please use [vb][/vb] tags for code | Posting Guidelines | Please check the MSDN and Search before posting
-- Other Sites: Did you search Google first? | My Blog
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple ADO/sql question seidenstud Database and Reporting 5 12-06-2002 03:01 PM
A Simple Question...... SolarCoasters General 5 11-07-2002 03:04 PM
Simple question blankenm General 6 09-08-2002 09:56 PM
Simple looping function question .... bradac General 3 06-06-2002 10:11 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->