?
Solved

MOVING TEXT = VB6

Posted on 2003-03-06
3
Medium Priority
?
1,141 Views
Last Modified: 2012-08-14
Could anyone please advise one , on how to do rolling text in a lblbox, one has attempted to do the following code but cannot get nothing to happen.

Private sub timer1_timer()
lbldate.caption=format(date,dd:mmmm:yyyy")
lbldate.refresh
end sub

private sub timer2_timer()
lblclock.caption=format(time,"hh:mm:ss")
lblclock.refresh
end sub


This is the code one is having trouble with below:

private sub timer3_timer()
lblmarquee.caption="Nice To See You Again"
lblmarquee.refresh
lblmarquee.move
lblmarquee.left+40,.top
If lblmarquee.left>(me.width-me.left) Then
lblmarquee.left
end if
end sub

Could anyone PLEASE suggest how one can add MOVING TEXT in a lblbox within a Frame. One would like it to MOVE from the right to the left repeating.

Thank You!
0
Comment
Question by:dreammaster
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 6

Expert Comment

by:PlanetCpp
ID: 8082510
you could either move the label in the frame by setting its left property. have two label that will act like a train as one goes out of view the other comes in then the one thats on the right will get moved behind the other and so on.
or use string manipulation to do it
use left and right functions to make it go
text
tex
te
t

t
xt
ext
text
simple loop and counter will do it with left and right functions
0
 
LVL 3

Accepted Solution

by:
speke earned 200 total points
ID: 8088923
Try using:

Dim intView As Integer
Dim strCaption As String

Private Sub Form_Load()

intView = 1
strCaption = "Nice To See You Again          Nice To See You Again           "

End Sub

Private Sub timer3_timer()

    lblMarquee.Caption = Mid(strCaption, intView, 21)

    intView = intView + 1
    If intView = 31 Then intView = 1
   
End Sub
0
 

Author Comment

by:dreammaster
ID: 8091493
Thank You for your help,

One would like to know how one could use two lblmarquee's one at the top as per your Input and one in the lbl at the bottom of the frame displaying two different messages.

One hopes you can advise me !

Thank you!.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Navigation is an important part of web design from a usability perspective. But it is often a pain when it comes to a developer’s perspective. By navigation, it often means menuing. This is less theory and more practical of how to get a specific gro…
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question