Radio Button in Group Boxes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Helen Trim

    #1

    Radio Button in Group Boxes


    Is there a group box property that tells you which radio button was clicked?

    --
    Helen
  • Herfried K. Wagner [MVP]

    #2
    Re: Radio Button in Group Boxes

    "Helen Trim" <HelenTrim@disc ussions.microso ft.com> schrieb:[color=blue]
    > Is there a group box property that tells you which radio button was
    > clicked?[/color]

    Add a common event handler to all the radio buttons which belong to a group:

    \\\
    Private m_Group1Selecte dRadioButton As RadioButton

    Private Sub RadioButtonGrou p1_CheckedChang ed( _
    ByVal sender As Object, _
    ByVal e As EventArgs _
    ) Handles _
    RadioButton1.Ch eckedChanged, _
    RadioButton2.Ch eckedChanged, _
    RadioButton3.Ch eckedChanged

    Dim SourceControl As RadioButton = DirectCast(send er, RadioButton)
    If SourceControl.C hecked Then
    m_Group1Selecte dRadioButton = 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/>

    Comment

    Working...