-
scrolling text on a form
Hello,
I am trying to create a form that has scrolling text on it. I do :-
Private Sub UserForm_Activate()
For i = 1 To 10
If Application.Wait(Now + TimeValue("0:00:01")) = True Then
Me.lblMessage.Caption = Mid("***Happy Xmas****", i, 15)
Me.Repaint
End If
Next i
Unload Me
End Sub
and it works fine but is slow. When I do :-
If Application.Wait(Now + (TimeValue("0:00:01")+0.5)) = True Then
instead the form just loads and unloads in a blink of an eye.
Is there an easier way to animate a form
Thanks
Phil
-
perhaps:
[vba]Private Sub UserForm_Activate()
For i = 1 To 10
endtime = Timer + 0.12
Do While Timer < endtime: Loop
Me.lblMessage.Caption = Mid("***Happy Xmas****", i, 15)
Me.Repaint
Next i
Unload Me
End Sub
[/vba]
p45cal
Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.
-
Perhaps
[VBA]Private Sub UserForm_Click()
Dim i As Long
For i = 1 To 10 Step 2
Me.Caption = Mid("***Happy Xmas****", i, 15)
Application.Wait Now + TimeValue("0:00:01")
Next i
End Sub
[/VBA]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules