Do any bady remember a thread which gave code to rotate text in a label.I forgot that id if any body can get me that I would be vary greatfull. I searched a lot but that didnt come up
Printable View
Do any bady remember a thread which gave code to rotate text in a label.I forgot that id if any body can get me that I would be vary greatfull. I searched a lot but that didnt come up
Not sure if you want to reverse or create a mirror image,
but here's how you reverse a label's caption:
Code:Private Sub Command1_Click()
Label1.Caption = ReverseCaption(Label1.Caption)
End Sub
Public Function ReverseCaption(revCaption As String) As String
Dim iRev As Integer
For iRev = Len(revCaption) To 1 Step -1
ReverseCaption = ReverseCaption & Mid(revCaption, iRev, 1)
Next iRev
End Function
No what I require is that the same efect of marquee in html. I will do that in a timer
for VB6, all you need is StrReverse("String to go backwards")Quote:
Originally posted by JohnVB6
Not sure if you want to reverse or create a mirror image,
but here's how you reverse a label's caption:
Code:Private Sub Command1_Click()
Label1.Caption = ReverseCaption(Label1.Caption)
End Sub
Public Function ReverseCaption(revCaption As String) As String
Dim iRev As Integer
For iRev = Len(revCaption) To 1 Step -1
ReverseCaption = ReverseCaption & Mid(revCaption, iRev, 1)
Next iRev
End Function
DOH!
DOH
I did'nt get please
I mean oops, how did I forget that.
Private V As Long
Private W As String
Private X As String
Private Y As Long
Private Z As Long
Private Sub CheckAgain()
W = Label1.Caption
Z = Len(W)
Y = 0
End Sub
Private Sub Form_Load()
Label1.Caption = "This is test..."
On Error GoTo ErrorHandlerNo
V = 0
CheckAgain
On Error GoTo 0
Form_Load:
Exit Sub
End If
ErrorHandlerNo:
If Err.Number = 364 Then
End
End If
End Sub
Private Sub Timer1_Timer()
X = Left(W, Y)
Label1.Caption = X
V = V + 1
If V < 45 Then ' V < 45 where 45 is the length of caption
Y = Y + 1
If Y > Z Then Y = 0
End If
End Sub
...
Here's the thread to some code I sent a while back.
http://www.vbforums.com/showthread.p...hreadid=175233