Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1143
  • Last Modified:

MOVING TEXT = VB6

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
dreammaster
Asked:
dreammaster
1 Solution
 
PlanetCppCommented:
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
 
spekeCommented:
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
 
dreammasterAuthor Commented:
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now