Cycle through radio buttons in a groupbox?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does anyone know how to programmatically cycle through a group of radio
buttons in a groupbox? I’ve tired groupbox.SelectNextControl() but it
selects the next control, not the next radiobutton. Thanks
 
Dear Eric,
What do you mean by Cyclin? If you want to loop through
all the controls in the groupbox you can just traverse the Controls
Arraylist of group box and check for each type weather its radio button
or not.

I hope it helps
Regards,
Naveed Ahmad Bajwa
http://bajoo.blogspot.com/
 
The Controls Array doesn't contain the radiobuttons, just the groupbox and
the normal buttons. If I try to get the groupbox.Controls I get the same
collection. Any Ideas?
 
Hi Eric,
You must be doing something wrong. Try this:
Take a new form. On the form put a Group box and put a few radio buttons in
it.
Also put a few more radio buttons outside the group box. Finally add a
button and try this code:
For Each c As Control In GroupBox1.Controls
MsgBox(c.Name)
Next
You'll get the names of the radio buttons *within* the group box, but no
others.
Hope this helps.
(BTW, I used VB 2005 Express)



"Eric" schreef:
 
Back
Top