<wino> schrieb:
I use several mutually exclusive radio boxes (with a group box).
How can I easily test which one is checked, do I need to do
a multiple if or case statement to check all of them one by one,
or is there a simpler way?
Add a common event handler to all the radio buttons which belong to a group:
\\\
Private m_Group1SelectedRadioButton As RadioButton
Private Sub RadioButtonGroup1_CheckedChanged( _
ByVal sender As Object, _
ByVal e As EventArgs _
) Handles _
RadioButton1.CheckedChanged, _
RadioButton2.CheckedChanged, _
RadioButton3.CheckedChanged
Dim SourceControl As RadioButton = DirectCast(sender, RadioButton)
If SourceControl.Checked Then
m_Group1SelectedRadioButton = SourceControl
End If
End Sub
///
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>