it asked for in many forums, Many times so i thought i'd add it here (Since this is my favourite forum).
Auto scroll text in a static label.
To your Form...
Add 1 label
Add 1 command Button
Add 1 Timer
Add 1 Textbox
Code: ( vb 6 )
DECLARATIONS:
Expand|Select|Wrap|Line Numbers
- Dim s As Integer
- Dim dta As String
- Private Sub Command1_Click()
- Label1.Caption = ""
- Timer1.Enabled = True
- Timer1.Interval = 100
- Label1.Width = 4335
- Label1.Font = "Palatino Linotype"
- Label1.Font.Size = 13
- Label1.Font.Bold = False
- End Sub
- Private Sub Timer1_Timer()
- ' put your text here in dta string
- dta = "Whatever text you want to scroll" & Space$(40)
- s = s + 1
- Label1.Caption = Mid(dta, 1, s)
- If Len(Label1.Caption) >= 42 Then Label1.Caption = Right(Label1.Caption, 41)
- If s = Len(dta) Then
- Label1.Caption = ""
- s = 0
- End If
- End Sub
Hope this helps , if you like this i have 85 more basic / very usefull how to's ready to use code samples.
GobbleGob.
Thanks for reading.