Home All Groups Group Topic Archive Search About

Radio Button in Group Boxes

Author
30 Jun 2005 11:17 AM
Helen Trim
Is there a group box property that tells you which radio button was clicked?

--
Helen

Author
30 Jun 2005 12:24 PM
Herfried K. Wagner [MVP]
"Helen Trim" <HelenT***@discussions.microsoft.com> schrieb:
> Is there a group box property that tells you which radio button was
> clicked?

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