I have a form with some buttons on it and when the button is clicked it changes the background color. Pretty simple and that part works fine when the form is first ran.
The issue I am having is if I hit another button on the form that is a 'RESET' button, that resets the background colors of the buttons back to what they originally were and when you try to click on the buttons again it now takes 2 clicks to get the button to activate.
Sample of my code:
The issue I am having is if I hit another button on the form that is a 'RESET' button, that resets the background colors of the buttons back to what they originally were and when you try to click on the buttons again it now takes 2 clicks to get the button to activate.
Sample of my code:
Code:
Private Sub LB1R1_Click(sender As Object, e As EventArgs) Handles LB1R1.Click
If LB1R1.BackColor = Color.Cyan Then
LB1R1.BackColor = Color.Black
Else
LB1R1.BackColor = Color.Cyan
End If
If LB1R1.BackColor = Color.Black Then
lb1r1e = 1
Else
lb1r1e = 0
End If
End Sub
Private Sub cmdreset_Click(sender As Object, e As EventArgs) Handles cmdreset.Click
LB1R1.BackColor = Color.Aqua
End Sub