For this example, add a Picture Box (named picHolder) and a Timer (named tmrScroll) to your form. Next, add a label called lblMsg within the Picture Box, and enter a few lines of text into its caption property. Then, add the code below, and run your project!
Private Sub Form_Load()
lblMsg.Top = picHolder.Height
tmrScroll.Interval = 10
tmrScroll.Enabled = True
End Sub
Private Sub tmrScroll_Timer()
If lblMsg.Top > -lblMsg.Height Then
lblMsg.Top = lblMsg.Top - 10
Else
lblMsg.Top = picHolder.Height
End If
End Sub
Comments