Tuesday, January 31, 2017

BLINKING TEXT COLOR CHANGE

Dim i As Integer = 0
Dim j As Integer

// on form load timer1.start() or timer1.enable=true

 Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick

        Dim str As String = "2017-01-01"
        Dim c(str.Length) As Char
        c = str.ToCharArray
        If j = 0 Then
            TextBox1.ForeColor = Color.Blue
            TextBox2.ForeColor = Color.Blue
            If i < str.Length Then
                'TextBox1.Text = TextBox1.Text & c(i)
                i = i + 1
            Else
                i = 0
                'TextBox1.Text = ""
            End If
            j = 1
        Else
            j = 0

            TextBox1.ForeColor = Color.Red
            TextBox2.ForeColor = Color.Red
        End If
    End Sub

No comments: