мигание кнопки в VB
Есть кнопка (visual basic 2010). При нажатии на неё открывается форма. Как заставить мигать кнопку?
может просто gif анимацию забакграундить...?
Код:
Public Class Form2
Dim memButtonBackColor As System.Drawing.Color
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
'запомнить текущий BackColor
memButtonBackColor = Button2.BackColor
'включить Таймер
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
Static tam As Boolean = False
Static ciklRepetition As Byte
If tam Then
Button2.BackColor = memButtonBackColor
tam = False
ciklRepetition += 1
'Баттон будет мигать 5 раз
If ciklRepetition = 5 Then
Timer1.Enabled = False
ciklRepetition = 0
End If
Else
Button2.BackColor = Color.DeepPink
tam = True
End If
End Sub
End Class
Dim memButtonBackColor As System.Drawing.Color
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
'запомнить текущий BackColor
memButtonBackColor = Button2.BackColor
'включить Таймер
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
Static tam As Boolean = False
Static ciklRepetition As Byte
If tam Then
Button2.BackColor = memButtonBackColor
tam = False
ciklRepetition += 1
'Баттон будет мигать 5 раз
If ciklRepetition = 5 Then
Timer1.Enabled = False
ciklRepetition = 0
End If
Else
Button2.BackColor = Color.DeepPink
tam = True
End If
End Sub
End Class