Author : Chirantan Bhattacharjee
Date Submitted : 4/11/2006
Category : Forms
Compatibility : VB 6
This code has been accessed 6693 times.
Task : This code will help u to marquee a text within a label.
Declarations
Code
Dim str As String
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 monty_cb@sify.com