Improving my status bar text crawl

C

Captain_Nemo

Gang -
This simple macro does what I want: it brings text onto the status bar
from the right and drops it off on the left at a 1/10 sec per character
rate. It could stand to be improved. The first loop is relatively
smooth because the period's spacing, though proportional, is constant.
The second loop is herky-jerky because of the proportional font being
used.

Can I control the status bar font to get a mono-spaced font? Can I get
to the pixel level and make a true scroll? Any other thoughts?

....best, Capt N.

Sub BarCrawl()

Dim strCrawl As String
Dim strCrawlStaticText As String
Dim i As Integer
Dim iLength As Integer
Dim bOriginalStatusBar As Boolean

strCrawlStaticText = "Your text goes here"
iLength = Len(strCrawlStaticText)
strCrawl = ""
bOriginalStatusBar = Application.DisplayStatusBar

For i = 1 To iLength
strCrawl = strCrawl & "."
Next i

Application.DisplayStatusBar = True

For i = 0 To iLength
Application.StatusBar = Right(strCrawl, iLength - i) &
Left(strCrawlStaticText, i)
Wait (0.1)
Next i

For i = 1 To iLength
Application.StatusBar = Right(strCrawlStaticText, iLength - i)
Wait (0.1)
Next i
Application.DisplayStatusBar = bOriginalStatusBar

End Sub

Sub Wait(t As Single)
Dim sTime As Single
sTime = Timer + t
Do While Timer < sTime
Loop
End Sub

--
Email to (e-mail address removed) (yes, you can so figure it out) ;-]

Scream and shout and jump for joy! I was here before Kilroy!

Sorry to spoil your little joke. I was here but my computer broke. ---Kilroy
 
T

Tom Ogilvy

It looked smooth enough to me. I would suspect you could divide the
characters into two groups (narrow and wide) and check each character
against the list, then wait a long or short period as appropriate. Seems
like it would take a lot more work to get beyond that. You would have more
control of the font if you did it in a cell, or used a textbox or userform.

--
Regards,
Tom Ogilvy

Gang -
This simple macro does what I want: it brings text onto the status bar
from the right and drops it off on the left at a 1/10 sec per character
rate. It could stand to be improved. The first loop is relatively
smooth because the period's spacing, though proportional, is constant.
The second loop is herky-jerky because of the proportional font being
used.

Can I control the status bar font to get a mono-spaced font? Can I get
to the pixel level and make a true scroll? Any other thoughts?

...best, Capt N.

Sub BarCrawl()

Dim strCrawl As String
Dim strCrawlStaticText As String
Dim i As Integer
Dim iLength As Integer
Dim bOriginalStatusBar As Boolean

strCrawlStaticText = "Your text goes here"
iLength = Len(strCrawlStaticText)
strCrawl = ""
bOriginalStatusBar = Application.DisplayStatusBar

For i = 1 To iLength
strCrawl = strCrawl & "."
Next i

Application.DisplayStatusBar = True

For i = 0 To iLength
Application.StatusBar = Right(strCrawl, iLength - i) &
Left(strCrawlStaticText, i)
Wait (0.1)
Next i

For i = 1 To iLength
Application.StatusBar = Right(strCrawlStaticText, iLength - i)
Wait (0.1)
Next i
Application.DisplayStatusBar = bOriginalStatusBar

End Sub

Sub Wait(t As Single)
Dim sTime As Single
sTime = Timer + t
Do While Timer < sTime
Loop
End Sub

--
Email to (e-mail address removed) (yes, you can so figure it out) ;-]

Scream and shout and jump for joy! I was here before Kilroy!

Sorry to spoil your little joke. I was here but my computer
broke. ---Kilroy
 
C

Captain_Nemo

Tom -

Thanks for taking the time to look at it. Unless you changed the "Your
text goes here" line I did a crappy job of providing an example. Should
have sprinkled some i's, l's, 1's and commas throughout. My choice was
unwittingly uniform.

You ideas are all good. I'll probably try the user form.

....best, Capt N.

Tom Ogilvy said:
It looked smooth enough to me. I would suspect you could divide the
characters into two groups (narrow and wide) and check each character
against the list, then wait a long or short period as appropriate. Seems
like it would take a lot more work to get beyond that. You would have more
control of the font if you did it in a cell, or used a textbox or userform.

--
Regards,
Tom Ogilvy

Gang -
This simple macro does what I want: it brings text onto the status bar
from the right and drops it off on the left at a 1/10 sec per character
rate. It could stand to be improved. The first loop is relatively
smooth because the period's spacing, though proportional, is constant.
The second loop is herky-jerky because of the proportional font being
used.

Can I control the status bar font to get a mono-spaced font? Can I get
to the pixel level and make a true scroll? Any other thoughts?

...best, Capt N.

Sub BarCrawl()

Dim strCrawl As String
Dim strCrawlStaticText As String
Dim i As Integer
Dim iLength As Integer
Dim bOriginalStatusBar As Boolean

strCrawlStaticText = "Your text goes here"
iLength = Len(strCrawlStaticText)
strCrawl = ""
bOriginalStatusBar = Application.DisplayStatusBar

For i = 1 To iLength
strCrawl = strCrawl & "."
Next i

Application.DisplayStatusBar = True

For i = 0 To iLength
Application.StatusBar = Right(strCrawl, iLength - i) &
Left(strCrawlStaticText, i)
Wait (0.1)
Next i

For i = 1 To iLength
Application.StatusBar = Right(strCrawlStaticText, iLength - i)
Wait (0.1)
Next i
Application.DisplayStatusBar = bOriginalStatusBar

End Sub

Sub Wait(t As Single)
Dim sTime As Single
sTime = Timer + t
Do While Timer < sTime
Loop
End Sub

--
Email to (e-mail address removed) (yes, you can so figure it out) ;-]

Scream and shout and jump for joy! I was here before Kilroy!

Sorry to spoil your little joke. I was here but my computer
broke. ---Kilroy

--
Email to (e-mail address removed) (yes, you can so figure it out) ;-]

Scream and shout and jump for joy! I was here before Kilroy!

Sorry to spoil your little joke. I was here but my computer broke. ---Kilroy
 

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

Top