VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Scrolls the Caption of the form

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'

Rate Scrolls the Caption of the form




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

Download this snippet    Add to My Saved Code

Scrolls the Caption of the form Comments

No comments have been posted about Scrolls the Caption of the form. Why not be the first to post a comment about Scrolls the Caption of the form.

Post your comment

Subject:
Message:
0/1000 characters