-
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
-
option1(index)
the index is passed as an integer to the Option1_Click() sub
-
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.
-
A.K.A. - Hungarian Notation
-
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.