by Chirantan Bhattacharjee (6 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 4th November 2006
Date Added: Mon 8th February 2021
Rating:
(1 Votes)
This code will help u to marquee a text within a label.
Private Sub Form_Load()
Me.Timer1.Enabled = False
str = Label1.Caption
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.Label1.BackColor = vbBlack
Me.Label1.ForeColor = &HFF8080
Timer1.Enabled = False
Me.Label1.Caption = Trim(str)
Label1.Alignment = 2
End Sub
Private Sub label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.Label1.BackColor = &HFF8080
Me.Label1.ForeColor = vbBlack
Me.Timer1.Enabled = True
Label1.Caption = Trim(Label1.Caption)
Label1.Alignment = 2
End Sub
Private Sub Timer1_Timer()
Label1.Caption = Label1.Caption + " "
If Len(Me.Label1.Caption) >= 56 Then
Label1.Caption = Right(Label1.Caption, Len(Label1.Caption) - 1)
End If
If Left(Me.Label1.Caption, 1) = " " Then
Label1.Alignment = 1
Label1.Caption = str
End If
End Sub
'make sure all the controls are taken in the form.
'Please reply how you like our service
'Please reply to [email protected]