Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Radio Button Control 1

Status
Not open for further replies.

Bruce1965

Programmer
Sep 17, 2004
54
GB
I have a from with a couple of Radio Buttons.

I've noticed that when either of the radio buttons is selected that the program executes the code twice.

Is there a way of stopping this???
 
what code does it execute?

Sure you do not have two sub routines?


ChrisCj21
MCSE, A+, N+
 
My guess is that it is because the checkchanged event fires twice, once for the radiobutton losing check status, and also for 2nd radiobutton getting check status.


Sweep
...if it works dont mess with it
 
Sweep - excellent observation, my guess entirely!!!!

Is there a way of stopping this??????


Cheers,
Paul
 
Code:
Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged, RadioButton2.CheckedChanged
  If CType(sender, RadioButton).Checked = True Then
    'My Code Here to only fire once
  End If
End Sub


Sweep
...if it works dont mess with it
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top