Quantcast
Viewing all articles
Browse latest Browse all 27056

VS 2010 Handling the RadioButton CheckedChanged event

I am having a problem handling the CheckedChanged event of a RadioButton group. I am using a common handler for both buttons, but it always fires twice ... once for checking the first button & once for unchecking the 2nd button & vice-versa. This is how I am currently doing it:

Code:

    Private Sub RadioButton_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged, RadioButton2.CheckedChanged

        Select Case True
            Case Me.RadioButton1.Checked
                'do something
            Case Me.RadioButton2.Checked
              'do something else
        End Select

    End Sub

Obviously this is not the proper way, since it doesn't work the way I want. Can somebody suggest how to make only fire once for each RB click? Thanks...

Viewing all articles
Browse latest Browse all 27056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>