Scrolling Text

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

You might also like...

Comments

James Crowley James first started this website when learning Visual Basic back in 1999 whilst studying his GCSEs. The site grew steadily over the years while being run as a hobby - to a regular monthly audience ...

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The difference between theory and practice is smaller in theory than in practice.”