Blinking button

  • Thread starter Thread starter tony wong
  • Start date Start date
T

tony wong

i wish to make the button blinking for 5 times at 1 second interval.

how come i cannot see the blinking effect?

is there any screen update function? Thanks.

******************************
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
If Button1.BackColor = Color.Red Then
Dim a
For a = 1 To 5
Button1.BackColor = Color.Yellow
System.Threading.Thread.Sleep(1000)
Button1.BackColor = Color.Red
Next
Else
Button1.BackColor = Color.Red
End If
End Sub
 
Add

Application.DoEvents()

after your sleep line.
__________________________________________
The Grim Reaper
 
Back
Top