Scrolling Message

S

Steve Haack

I would like to put a banner on a Form and have the text in it automatically
scroll (crawl) from left to right (like a stock ticker, for example).

Does anyone know of a way to do that?

Thanks,
Steve
 
F

fredg

I would like to put a banner on a Form and have the text in it automatically
scroll (crawl) from left to right (like a stock ticker, for example).

Does anyone know of a way to do that?

Thanks,
Steve

You would use code in the form's timer event.

Add a label to the form.
Set the Timer Interval to 1000.

Code the Timer event:

Private Sub Form_Timer()
Dim strMsg As String
Static I As Integer
I = I + 1
strMsg = "some message here "

' Display then exit
' To display the message just one time
If I > Len(strMsg) Then Exit Sub

' or if you wish to repeat the message
' If I > len(strMsg) Then I = 1
LabelName.Caption = LabelName.Caption & Mid(strMsg, I, 1)

End Sub

To slow the message down, set the Timer Interval to a greater value
(1000 = 1 second).
To speed the message up, decrease the Timer Interval value.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top