PDA

Click to See Complete Forum and Search --> : Option Buttons - programmatic partial disabling


prestodsi
Nov 8th, 1999, 05:21 AM
If I have 10 option buttons in two containers at the same form (for example, 2 in frame1 and 8 in frame2.

If the user chooses opt1 (in frame1) not all of the choices in frame 2 are valid. Suppose that only opt3, opt4 and opt5 are valid choices.

I know how to change the properties programatically, yet I would like to use a For...Next statement to do it.

Its a simple code, yet I am stuck in my attempts.

Can anybody help, please???




------------------
Paul Stermann
DSI-Houston

ShadowCrawler
Nov 8th, 1999, 05:27 AM
You can't reference object names like strings (i.e. ("Opt" & i).Enabled = False). Instead, use a control array. Then just do:

For i = 0 to 5
Opt(i).Enabled = False
Next i



Or however you wish to apply it.

------------------
(¯`·.¸¸.·´¯`·->ShadowCrawler<-·´¯`·.¸¸.·´¯)
Teenage Programmer
Visual Basic, HTML, C++, JavaScript
http://welcome.to/X12Tech
Email: craigkovatch@compuserve.com
ICQ#: 9872708 (http://wwp.mirabilis.com/9872708)