Blink text in vb.net

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Timer1.Interval = 500
        Timer1.Enabled = True
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Static s1 As Boolean
        Static i As Long
        i = i + 1
        If i < 120 Then
            s1 = Not s1
            If s1 Then
                Label1.BackColor = Color.Yellow
                Label1.ForeColor = Color.Red
            Else
                Label1.BackColor = Color.Green
                Label1.ForeColor = Color.Beige

            End If
        Else
            Timer1.Enabled = False
            i = 0
        End If
    End Sub
End Class

Ebook Download
View all
Learn
View all