by Vasudev D.Sharma (2 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 24th October 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Scrolls the Caption of the form
API Declarations
' and StopScroll to stop scrolling
' use ScrollSpeed to change speed
' It also needs a timer with name 'Timer1'
Dim FormCaption As String
Dim Caption2Scroll As String
Dim CaptionLength As Integer
Dim ScrollSpeed As Integer
Public Sub StartScroll()
Caption2Scroll = Space(256) & Me.Caption
CaptionLength = Len(Space(256) + FormCaption)
Timer1.Interval = ScrollSpeed
Timer1.Enabled = True
End Sub
Public Sub StopScroll()
Timer1.Enabled = False
Me.Caption = FormCaption
End Sub
Private Sub Form_Load()
ScrollSpeed = 100
Call StartScroll
End Sub
Private Sub timer1_Timer()
Me.Caption = Right(Caption2Scroll, CaptionLength)
CaptionLength = CaptionLength - 1
If CaptionLength = 0 Then
CaptionLength = Len(Space(256) + FormCaption)
End If
End Sub