by E. Stephens (3 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 17th December 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Make a Marquee with alternating behavior
API Declarations
Dim slide as Integer
'Add a shape control "Shape1" (a long skinny rectangle)
'This serves as a track for the words. Set the visible
'property to False
'Put a Label "Label1" inside the shape with the same
'height (top and bottom but not the same width)
'Set the label1 alignment property to "1- right justify"
'set the backstyle on the label1 "1-opaque"
'Add the code to the form load and timer event
Private Sub Form_Load()
Timer1.Interval = 70
slide = 70
End Sub
Private Sub Timer1_Timer()
If Label1.Left < Shape1.Left Then
slide = 70
ElseIf Label1.Left + Label1.Width > Shape1.Left +
Shape1.Width Then
slide = -70
End If
Label1.Left = Label1.Left + slide
End Sub