By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,041 Members | 1,099 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,041 IT Pros & Developers. It's quick & easy.

Looping through radiobuttons

P: n/a
Hi All,

I have 5 radiobuttons in a groupbox and I'm trying to uncheck all of them:

Dim ctrl as Control
For each ctrl in GB.Controls
If TypeOf ctrl Is RadioButton Then
ctrl.Checked=False 'This doesn't work!
Endif
Next

I can change ctrl from Control to RadioButton, but there are other controls
in the groupbox (not radiobutons).

Is there an easier way to uncheck all of the radiobuttons in a groupbox?

TIA
Lee
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a

"lgbjr"

You get probably a lot of answers on this easy one.

DirectCast(ctrl,RadioButton).Checked=False

Cor
Nov 21 '05 #2

P: n/a

lgbjr wrote:
Hi All,

I have 5 radiobuttons in a groupbox and I'm trying to uncheck all of them:

Dim ctrl as Control
For each ctrl in GB.Controls
If TypeOf ctrl Is RadioButton Then
ctrl.Checked=False 'This doesn't work!
DirectCast(ctrl, RadioButton).Checked = False 'This should work! :)
Endif
Next
Is there an easier way to uncheck all of the radiobuttons in a groupbox?


Don't think so.

--
Larry Lard
Replies to group please

Nov 21 '05 #3

P: n/a
LOL!

MyBrain.enabled=False

thanks
Lee

"Cor Ligthert" <no************@planet.nl> wrote in message
news:Os**************@TK2MSFTNGP14.phx.gbl...

"lgbjr"

You get probably a lot of answers on this easy one.

DirectCast(ctrl,RadioButton).Checked=False

Cor

Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.