Skip to content

Instantly share code, notes, and snippets.

@rk215
Created March 23, 2017 07:10
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/56b9c663fea550eba7e9eadb108abbf4 to your computer and use it in GitHub Desktop.
Save rk215/56b9c663fea550eba7e9eadb108abbf4 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
@rk215
Copy link
Author

rk215 commented Mar 23, 2017

Download it this code and run it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment