Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleMake a ticker tape display
DescriptionThis example shows how to make a ticker tape display in Visual Basic 6. When a timer fires, the program draws text on a PictureBox, shifting it slightly each time so it moves across the screen.
Keywordsticker, scrolling text
CategoriesControls
 
Use a Timer to move the text periodically.
 
Private Sub Timer1_Timer()
Const MESSAGE = "Visual Basic Graphics Code Library"

Static done_before As Boolean
Static msg_width As Single
Static X As Single

    If Not done_before Then
        msg_width = Picture1.TextWidth(MESSAGE)
        done_before = True
        X = Picture1.ScaleWidth
    End If

    Picture1.Cls
    Picture1.CurrentX = X
    Picture1.CurrentY = 0
    Picture1.Print MESSAGE

    X = X - 30
    If X < -msg_width Then X = Picture1.ScaleWidth
End Sub
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated