Results 1 to 10 of 10

Thread: lablels

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2002
    Location
    Earth
    Posts
    171

    lablels

    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

  2. #2
    Hyperactive Member
    Join Date
    May 2002
    Location
    Chicago
    Posts
    271
    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
    Sometimes what you're looking for is exactly where you left it.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Apr 2002
    Location
    Earth
    Posts
    171
    No what I require is that the same efect of marquee in html. I will do that in a timer

  4. #4
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    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
    for VB6, all you need is StrReverse("String to go backwards")
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  5. #5
    Hyperactive Member
    Join Date
    May 2002
    Location
    Chicago
    Posts
    271

    Lightbulb

    DOH!
    Sometimes what you're looking for is exactly where you left it.

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Apr 2002
    Location
    Earth
    Posts
    171
    DOH

    I did'nt get please

  7. #7
    Hyperactive Member
    Join Date
    May 2002
    Location
    Chicago
    Posts
    271

    Wink

    I mean oops, how did I forget that.
    Sometimes what you're looking for is exactly where you left it.

  8. #8
    ^:^...ANGEL...^:^ wrack's Avatar
    Join Date
    Mar 2002
    Location
    Melbourne, AUSTRALIA
    Posts
    2,695

    Thumbs up Try this...

    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

  9. #9
    ^:^...ANGEL...^:^ wrack's Avatar
    Join Date
    Mar 2002
    Location
    Melbourne, AUSTRALIA
    Posts
    2,695

    Thumbs up Sorry...Check the file attached...

    ...
    Attached Files Attached Files

  10. #10
    Hyperactive Member
    Join Date
    May 2002
    Location
    Chicago
    Posts
    271
    Here's the thread to some code I sent a while back.
    http://www.vbforums.com/showthread.p...hreadid=175233
    Sometimes what you're looking for is exactly where you left it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width