Scrolling Text using Timer in VB.Net

This tutorial demonstrates the animation of scrolling the text from bottom to top using Label and Timer.

Step 1:

Create a form and add a Label, In the Text Property, type any word that you want then set the Location Property to 49, 263.


Step 2:
Add a Timer Object and set the Interval Property to 20, then paste this code:


Public Class frmScrollText
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Label1.Location = New Point(Label1.Location.X, Label1.Location.Y - 1)
        If Label1.Location = New Point(94, -416) Then
            Label1.Location = New Point(94, 264)
        End If
    End Sub
End Class


Final Output:


Scrolling Text using Timer in VB.Net Scrolling Text using Timer in VB.Net Reviewed by code-dev on 10:23 PM Rating: 5

No comments:

Powered by Blogger.