Skip to content

.Net – Find Checked Radiobutton in GroupBox

September 17, 2012
'Pre-Linq
For Each c As Control In gb.Controls
   If Not (TypeOf c Is RadioButton AndAlso DirectCast(c, RadioButton).Checked) Then Continue For
   'Do something here
   Exit For
Next

'Linq
For Each rb As RadioButton In gb.Controls.OfType(Of RadioButton)
   If Not rb.Checked Then Continue For
   'Do something here
   Exit For
Next
Advertisements

From → .Net

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: