Cycle through radio buttons in a groupbox?

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
 
B

Bajoo

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/
 
G

Guest

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?
 
G

Guest

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:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top