Display Label Letter By Letter In VB.Net

How To Show Label Letter By Letter Using Visual Basic .Net

How To Show Label Letter By Letter In VB.Net


In This VB.NET Tutorial we will see How To Show Label Text Letter By Letter Using Timer 
Using Visual Basic .NET Programming Language.


Project Source Code:

Public Class VB_Letter_By_Letter

    Dim len As Integer
    Dim counter As Integer
    Dim txt As String

    Private Sub VB_Letter_By_Letter_Load(sender As Object, e As EventArgs) Handles MyBase.Load

        counter = 0
        len = Label1.Text.Length
        txt = Label1.Text
        Label1.Text = ""
        Timer1.Start()

    End Sub

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

        counter += 1

        If counter > len Then

            counter = 0
            Label1.Text = ""

        Else
            Label1.Text = txt.Substring(0, counter)

            If Label1.ForeColor = Color.Red Then
                Label1.ForeColor = Color.Green
            Else
                Label1.ForeColor = Color.Red
            End If

        End If



    End Sub
End Class





Share this

Related Posts

Previous
Next Post »