Skip to content

Instantly share code, notes, and snippets.

@rk215
Created March 23, 2017 06:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rk215/56036f5a09594169382deb9580f13502 to your computer and use it in GitHub Desktop.
Save rk215/56036f5a09594169382deb9580f13502 to your computer and use it in GitHub Desktop.
Public Class Form1
Dim t As Integer = 1 'declare globle variable t type of integer.
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Timer1.Start() 'start timer at form load.
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
If Label1.Left + Label1.Width > 0 Then 'to check wether left and width propertie of label control is greater than 0 or not
Label1.Left -= t
t += 1
Else
Label1.Left = Me.Width
End If
End Sub
End Class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment