|
-
Nov 10th, 2000, 11:48 AM
#1
Thread Starter
Hyperactive Member
Hi all,
I placed the option1 in my form, and copied the option1
5 times. Which is now option1(0) option1(4). However,
when the user clicks on any of the option1(0-4), can I
tell which index was selected/clicked?
I don't want to check option1(0).value - option1(4).value
to see which one was selected, but if that is the only way,
please let me know.
Thanks
-
Nov 10th, 2000, 11:51 AM
#2
option1(index)
the index is passed as an integer to the Option1_Click() sub
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Nov 10th, 2000, 12:02 PM
#3
Frenzied Member
optTest_click
I just created a control Array of Options named "optTest." VB creaated the following Subroutine.
Code:
Private Sub optTest_Click(Index As Integer)
'In this Sub, Index will have a value of 0, 1, 2 ...
'depending on which option was clicked
End Sub
I hope the above helps.
You should not use VB default names. Rename your controls, text boxes, et cetera to something meaningful to you.
I usually use the first three or four characters to indicate what the object is.
Live long & prosper.
The Dinosaur from prehistoric era prior to computers.
Eschew obfuscation!
If a billion people believe a foolish idea, it is still a foolish idea!
VB.net 2010 Express
64Bit & 32Bit Windows 7 & Windows XP. I run 4 operating systems on a single PC.
-
Nov 10th, 2000, 12:04 PM
#4
A.K.A. - Hungarian Notation
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Nov 10th, 2000, 08:40 PM
#5
Frenzied Member
Another thot.
After making my previous post, it occurred to me that perhaps you should not be using a control array for your options. Why not give each a different name?
For example, I have a gravitational computation application which allows for 3 different coordinate systems. My Options are named optCartesian, optCylindrical, & optSpherical. VB created 3 subroutines: optCartesian_Click, optCylnidrical_Click, & optSpherical_Click.
If you have more than one set of options, you can put each set on a different frame.
Live long & prosper.
The Dinosaur from prehistoric era prior to computers.
Eschew obfuscation!
If a billion people believe a foolish idea, it is still a foolish idea!
VB.net 2010 Express
64Bit & 32Bit Windows 7 & Windows XP. I run 4 operating systems on a single PC.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|