PC Review


Reply
Thread Tools Rate Thread

animated text in a userform?

 
 
Robert Crandal
Guest
Posts: n/a
 
      24th Nov 2009
I was thinking about placing a long sentence into a label
on a userform. Since the text is really long, and my userform
will be really short (lengthwise), would it be possible to make
the text continuously animated?? I mean, I would like
my text to constantly scroll and wrap around, kinda like
those stock ticker things.

Would the animation need to rely on some sort of timer which
instructs the userform to constantly update itself??

thank you!


 
Reply With Quote
 
 
 
 
Trevithick
Guest
Posts: n/a
 
      25th Nov 2009
I don't know of any tool to do what you are wanting to do, but a thought
comes to mind.

Try using a string function and some additional code so that you constantly
remove the first character of your string and concatenate it to the end, and
then update your forms' label. The possible problem is a blinking userform
that would drive you or your users crazy.

--
Mark Trevithick


"Robert Crandal" wrote:

> I was thinking about placing a long sentence into a label
> on a userform. Since the text is really long, and my userform
> will be really short (lengthwise), would it be possible to make
> the text continuously animated?? I mean, I would like
> my text to constantly scroll and wrap around, kinda like
> those stock ticker things.
>
> Would the animation need to rely on some sort of timer which
> instructs the userform to constantly update itself??
>
> thank you!
>
>
> .
>

 
Reply With Quote
 
Rick Rothstein
Guest
Posts: n/a
 
      25th Nov 2009
I agree with Mark... this will drive your users crazy and it will be hard to
read. What about assigning the long text to the ControlTipText property of
the Label? That way, unless the text is humungously long, it will be be
displayed in its entirety when the user hovers the mouse over the control.

--
Rick (MVP - Excel)


"Robert Crandal" <(E-Mail Removed)> wrote in message
news:VpYOm.45553$%(E-Mail Removed)...
>I was thinking about placing a long sentence into a label
> on a userform. Since the text is really long, and my userform
> will be really short (lengthwise), would it be possible to make
> the text continuously animated?? I mean, I would like
> my text to constantly scroll and wrap around, kinda like
> those stock ticker things.
>
> Would the animation need to rely on some sort of timer which
> instructs the userform to constantly update itself??
>
> thank you!
>
>


 
Reply With Quote
 
Robert Crandal
Guest
Posts: n/a
 
      25th Nov 2009
Is the ControlTipText thing sort of like a floating text box
kinda similar to the comment-box that you can install in Excel
cells?? This might be what I'm looking for.

BTW, if another application is in the foreground, and Excel
is behind/underneath it (but partially visible), AND if I hover
the mouse pointer over my userform (which is in the background),
will the ControlTipText still appear??? (I hope that question
isnt too confusing, hehe!)

Thanks so much Rick!


"Rick Rothstein" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I agree with Mark... this will drive your users crazy and it will be hard
>to read. What about assigning the long text to the ControlTipText property
>of the Label? That way, unless the text is humungously long, it will be be
>displayed in its entirety when the user hovers the mouse over the control.
>
> --
> Rick (MVP - Excel)
>


 
Reply With Quote
 
Robert Crandal
Guest
Posts: n/a
 
      25th Nov 2009
I played with this ControlTipText and it appears that it only becomes
visible when when both Excel and my Userform are in the foreground.
Too bad!

We dont have much space on our monitors, so I was looking for some
way to have my text become visible in front of all the other applications we
got running. Hmmm, what to do, what to do?


"Robert Crandal" <(E-Mail Removed)> wrote in message
news:LG4Pm.86$(E-Mail Removed)...
> Is the ControlTipText thing sort of like a floating text box
> kinda similar to the comment-box that you can install in Excel
> cells?? This might be what I'm looking for.
>
> BTW, if another application is in the foreground, and Excel
> is behind/underneath it (but partially visible), AND if I hover
> the mouse pointer over my userform (which is in the background),
> will the ControlTipText still appear??? (I hope that question
> isnt too confusing, hehe!)
>
> Thanks so much Rick!
>


 
Reply With Quote
 
Rick Rothstein
Guest
Posts: n/a
 
      25th Nov 2009
See inline comments...

> Is the ControlTipText thing sort of like a floating text box
> kinda similar to the comment-box that you can install in Excel
> cells?? This might be what I'm looking for.


Yes, but unlike the Comment Box which activates immediately, there is a
slight delay before the ControlTipText displays.

> BTW, if another application is in the foreground, and Excel
> is behind/underneath it (but partially visible), AND if I hover
> the mouse pointer over my userform (which is in the background),
> will the ControlTipText still appear??? (I hope that question
> isnt too confusing, hehe!)


No, the ControlTipText will only activate if the UserForm has focus (this is
pretty much standard Windows functionality).

--
Rick (MVP - Excel)


>
> "Rick Rothstein" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>I agree with Mark... this will drive your users crazy and it will be hard
>>to read. What about assigning the long text to the ControlTipText property
>>of the Label? That way, unless the text is humungously long, it will be be
>>displayed in its entirety when the user hovers the mouse over the control.
>>
>> --
>> Rick (MVP - Excel)
>>

>


 
Reply With Quote
 
Trevithick
Guest
Posts: n/a
 
      26th Nov 2009
I agree with Rick and have used his technique in the past. Assigning the
long string to the ControlTipText property is an easy and clean way to still
make your message available. To me, a clean interface is critical for end
users.

However, having said that, I thought I recalled John Walkenbach having an
example in his Excel 2007 Power Programming with vba. I was right, but tried
unsuccessfully for a couple of hours to cobble something together that would
work using the method I mentioned above.

I finally broke down and retrieved from my library of Walkenbach books the
answer. I was right in remembering an example. I finally modified my close
but no cigar method and used insights from Walkenbach's example and got it to
"work". I was unsuccessful even after getting it to scroll, to control the
speed of the scrolling. It is unreadable because of the speed that it
refreshes the label. And, it also required a control on the UserForm to
initiate and stop the scrolling. I could not discover a way to cause it to
scroll without it. Perhaps, and I didn't try it, use a mouseover event for
the initiation.

All the code resides in the UserForm, and follows:

Option Explicit

Dim myString As String
Dim myStringLen As Integer
Dim myLabel As String
Dim myLabelLeft As String
Dim myLabelRight As String
Dim myCaption As String
Dim myCaptionLeft As String
Dim myCaptionRight As String
Dim x As Integer
Dim myInterval As Integer
Dim Stopped As Boolean

Private Sub cmdStartStop_Click()

myString = "Let me see if I can think of some long string to scroll. "
myStringLen = Len(myString)
myLabel = myString
myCaption = myString
myInterval = 7

If cmdStartStop.Caption = "Start" Then
cmdStartStop.Caption = "Stop"

Stopped = False

Do Until Stopped
For x = 1 To myStringLen

'Display controls
lblScrollText = myLabel
txtX = x
txtLabelLength = myStringLen
frmScrollText.Caption = myCaption

'Change myLabel
myLabelLeft = Left(myLabel, myInterval)
myLabelRight = Right(myLabel, myStringLen - myInterval)
myLabel = myLabelRight & myLabelLeft

'Change myCaption
myCaptionLeft = Left(myCaption, myStringLen - myInterval)
myCaptionRight = Right(myCaption, myInterval)
myCaption = myCaptionRight & myCaptionLeft

DoEvents 'Causes the animation
Next
Loop

Else
Stopped = True
cmdStartStop.Caption = "Start"

End If

End Sub
--
Mark Trevithick


"Rick Rothstein" wrote:

> See inline comments...
>
> > Is the ControlTipText thing sort of like a floating text box
> > kinda similar to the comment-box that you can install in Excel
> > cells?? This might be what I'm looking for.

>
> Yes, but unlike the Comment Box which activates immediately, there is a
> slight delay before the ControlTipText displays.
>
> > BTW, if another application is in the foreground, and Excel
> > is behind/underneath it (but partially visible), AND if I hover
> > the mouse pointer over my userform (which is in the background),
> > will the ControlTipText still appear??? (I hope that question
> > isnt too confusing, hehe!)

>
> No, the ControlTipText will only activate if the UserForm has focus (this is
> pretty much standard Windows functionality).
>
> --
> Rick (MVP - Excel)
>
>
> >
> > "Rick Rothstein" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> >>I agree with Mark... this will drive your users crazy and it will be hard
> >>to read. What about assigning the long text to the ControlTipText property
> >>of the Label? That way, unless the text is humungously long, it will be be
> >>displayed in its entirety when the user hovers the mouse over the control.
> >>
> >> --
> >> Rick (MVP - Excel)
> >>

> >

>
> .
>

 
Reply With Quote
 
Andy Pope
Guest
Posts: n/a
 
      26th Nov 2009
Hi,

If you really, really want to do it try using this variation of a marquee.
http://www.ozgrid.com/forum/showthre...hlight=marquee

Userform with additional Toolbox control. MS Web browser.

userform code that will, when clicked, display the contents of A1 on active
sheet.
Private Sub UserForm_Click()

Dim intUnit As Integer
Dim strTemp As String

strTemp = "<html><head><script language=""javascript"">function
noScroll(){document.body.scroll=""no"";}" & _
"</script></head><body onload=javascript:noScroll();
topmargin=""0"" leftmargin=""0"">" & _
"<marquee width=""198"" height=""22"">" & _
Range("A1").Value & _
"</marquee></body></html>"
intUnit = FreeFile
Open ThisWorkbook.Path & "\zzxqvk.htm" For Output As intUnit
Print #intUnit, strTemp
Close intUnit
Me.WebBrowser1.Navigate2 ThisWorkbook.Path & "\zzxqvk.htm"
Me.WebBrowser1.Visible = True

End Sub

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Trevithick" <(E-Mail Removed)> wrote in message
news:553940F4-1F56-4E8F-860E-(E-Mail Removed)...
>I agree with Rick and have used his technique in the past. Assigning the
> long string to the ControlTipText property is an easy and clean way to
> still
> make your message available. To me, a clean interface is critical for end
> users.
>
> However, having said that, I thought I recalled John Walkenbach having an
> example in his Excel 2007 Power Programming with vba. I was right, but
> tried
> unsuccessfully for a couple of hours to cobble something together that
> would
> work using the method I mentioned above.
>
> I finally broke down and retrieved from my library of Walkenbach books the
> answer. I was right in remembering an example. I finally modified my
> close
> but no cigar method and used insights from Walkenbach's example and got it
> to
> "work". I was unsuccessful even after getting it to scroll, to control
> the
> speed of the scrolling. It is unreadable because of the speed that it
> refreshes the label. And, it also required a control on the UserForm to
> initiate and stop the scrolling. I could not discover a way to cause it
> to
> scroll without it. Perhaps, and I didn't try it, use a mouseover event
> for
> the initiation.
>
> All the code resides in the UserForm, and follows:
>
> Option Explicit
>
> Dim myString As String
> Dim myStringLen As Integer
> Dim myLabel As String
> Dim myLabelLeft As String
> Dim myLabelRight As String
> Dim myCaption As String
> Dim myCaptionLeft As String
> Dim myCaptionRight As String
> Dim x As Integer
> Dim myInterval As Integer
> Dim Stopped As Boolean
>
> Private Sub cmdStartStop_Click()
>
> myString = "Let me see if I can think of some long string to scroll. "
> myStringLen = Len(myString)
> myLabel = myString
> myCaption = myString
> myInterval = 7
>
> If cmdStartStop.Caption = "Start" Then
> cmdStartStop.Caption = "Stop"
>
> Stopped = False
>
> Do Until Stopped
> For x = 1 To myStringLen
>
> 'Display controls
> lblScrollText = myLabel
> txtX = x
> txtLabelLength = myStringLen
> frmScrollText.Caption = myCaption
>
> 'Change myLabel
> myLabelLeft = Left(myLabel, myInterval)
> myLabelRight = Right(myLabel, myStringLen - myInterval)
> myLabel = myLabelRight & myLabelLeft
>
> 'Change myCaption
> myCaptionLeft = Left(myCaption, myStringLen - myInterval)
> myCaptionRight = Right(myCaption, myInterval)
> myCaption = myCaptionRight & myCaptionLeft
>
> DoEvents 'Causes the animation
> Next
> Loop
>
> Else
> Stopped = True
> cmdStartStop.Caption = "Start"
>
> End If
>
> End Sub
> --
> Mark Trevithick
>
>
> "Rick Rothstein" wrote:
>
>> See inline comments...
>>
>> > Is the ControlTipText thing sort of like a floating text box
>> > kinda similar to the comment-box that you can install in Excel
>> > cells?? This might be what I'm looking for.

>>
>> Yes, but unlike the Comment Box which activates immediately, there is a
>> slight delay before the ControlTipText displays.
>>
>> > BTW, if another application is in the foreground, and Excel
>> > is behind/underneath it (but partially visible), AND if I hover
>> > the mouse pointer over my userform (which is in the background),
>> > will the ControlTipText still appear??? (I hope that question
>> > isnt too confusing, hehe!)

>>
>> No, the ControlTipText will only activate if the UserForm has focus (this
>> is
>> pretty much standard Windows functionality).
>>
>> --
>> Rick (MVP - Excel)
>>
>>
>> >
>> > "Rick Rothstein" <(E-Mail Removed)> wrote in message
>> > news:(E-Mail Removed)...
>> >>I agree with Mark... this will drive your users crazy and it will be
>> >>hard
>> >>to read. What about assigning the long text to the ControlTipText
>> >>property
>> >>of the Label? That way, unless the text is humungously long, it will be
>> >>be
>> >>displayed in its entirety when the user hovers the mouse over the
>> >>control.
>> >>
>> >> --
>> >> Rick (MVP - Excel)
>> >>
>> >

>>
>> .
>>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
animated text box sahmh Microsoft Powerpoint 2 8th Aug 2009 09:11 PM
Animated gif on userform Avi Microsoft Excel Programming 0 15th May 2006 06:38 AM
Animated Text Joyce Microsoft Outlook 3 11th Oct 2004 08:01 PM
Re: Animated Text Harlan Grove Microsoft Excel Worksheet Functions 0 30th Oct 2003 07:48 PM
Re: Animated Text CLR Microsoft Excel Worksheet Functions 0 30th Oct 2003 01:16 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:44 AM.