Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sun Sep 15, 2019 8:50 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Text scroll
PostPosted: Sat Apr 17, 2010 2:45 pm 
Offline
User avatar

Joined: Sat Apr 04, 2009 5:10 pm
Posts: 954
Once you learn how to use the Timer control, you can do many simple but interesting things. It's a pity that LR's example code for the Timer control is not very practical, which prevented me from exploring it for months.

The following is a simple example for a text scroll effect with the Timer control. MsgField1 has a text message, and StaticText1 is where it'll be scrolled.

Dim i As Integer
Static Count As Integer
Count=Count+1
If Count> Len(MsgField1.Text) Then Count=1
For i=1 To Len(MsgField1.Text)
Select Case Count
Case i
StaticText1.Text=Left(MsgField1.Text,i)
End
Next i


You may want to append some space as much as the width of StaticText1 to the original message text so that the message text will entirely disappear to the left.

_________________
Mac OS X 10.5.8/REALBasic 2008 R5.1 ~ REALBasic 2009 R4
--------------------------------------------------
Please don't use my topics in order to advertise your plug-ins.
Watch out for European spammers who try to sell plug-ins you don't even need.


Top
 Profile  
Reply with quote  
 Post subject: Re: Text scroll
PostPosted: Sun Apr 18, 2010 9:29 am 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
Whats up with the Select Statement????

Dim i As Integer
Static Count As Integer
Count=Count+1
If Count> Len(MsgField1.Text) Then Count=1
For i=1 To Len(MsgField1.Text)
StaticText1.Text=Left(MsgField1.Text,i)
Next i

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: Text scroll
PostPosted: Sun Apr 18, 2010 11:07 am 
Offline
User avatar

Joined: Wed Nov 15, 2006 3:50 pm
Posts: 2353
Location: England
Quote:
Whats up with the Select Statement????


Its 'left over' from earlier attempts to get the code working. See other posts.

_________________
Still RB2009 R5.1
Mac 10.6 + Windows 7/XP + Ubuntu Linux in Vmware
on a Macbook 2.16


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group