VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Marquee the text

by jayakumar (1 Submission)
Category: Graphics
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 17th July 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Marquee the text

Rate Marquee the text




'Some initializations. We could have done this in the control's properties window.
Private Sub Form_Load()
    sldrSpeed.Max = 100
    sldrSpeed.Min = 1
    sldrSpeed.Value = 1
    
    Timer1.Enabled = False
    Timer1.Interval = sldrSpeed.Value
    Timer1.Enabled = False
End Sub

'Check the value of the checkbox control to see if we should animate the marquee
Private Sub chkAnimate_Click()
    If chkAnimate.Value = 0 Then
        Timer1.Enabled = False
        sldrSpeed.Enabled = False
    Else
        Timer1.Enabled = True
        sldrSpeed.Enabled = True
    End If
End Sub


' Reset the timer to the value indicated by the slider control
Private Sub sldrSpeed_Scroll()
    Timer1.Interval = sldrSpeed.Value
End Sub

Private Sub Timer1_Timer()
    Static Count As Integer
    
    'When the label goes off the left side of the form,
    ' reposition it onto the right side.
    If (lblMarquee.Left + lblMarquee.Width) <= 0 Then
        lblMarquee.Left = Form1.Width
        
        'Use the status bar to show how often the marquee has cycled.
        Count = Count + 1
        StatusBar1.Panels(1).Text = CStr(Count)
    End If
    
    lblMarquee.Left = lblMarquee.Left - 100
End Sub


Download this snippet    Add to My Saved Code

Marquee the text Comments

No comments have been posted about Marquee the text. Why not be the first to post a comment about Marquee the text.

Post your comment

Subject:
Message:
0/1000 characters