Results 1 to 7 of 7

Thread: Scroll The Window Caption

  1. #1

    Thread Starter
    Frenzied Member SeanK's Avatar
    Join Date
    May 2002
    Location
    Boston MA
    Posts
    1,160

    Scroll The Window Caption

    Does anyone know how to scroll the caption of a window?
    Beantown Boy
    Please use [highlight=vb]your code goes in here[/highlight] tags when posting code.
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Do you mean like "Form1" in the window caption?

    You want to scroll that across the window continously?

  3. #3

    Thread Starter
    Frenzied Member SeanK's Avatar
    Join Date
    May 2002
    Location
    Boston MA
    Posts
    1,160
    Yes sir, sir!
    Beantown Boy
    Please use [highlight=vb]your code goes in here[/highlight] tags when posting code.
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    VB Code:
    1. 'to scroll right to left
    2. Private Sub Timer1_Timer()
    3.     Me.Caption = "  Scrolling Window Caption Form  "
    4.     MyCaption = Me.Caption
    5.     If MyCaption = "" Then Exit Sub
    6.  
    7.         For i = 0 To Len(MyCaption)
    8.             LastCaptionChar = Left(MyCaption, 1)
    9.             Me.Caption = Mid(MyCaption, 2) & LastCaptionChar
    10.         Next
    11. End Sub
    12.  
    13. 'to scroll left to right
    14. Private Sub Timer2_Timer()
    15.     Me.Caption = "  Scrolling Window Caption Form  "
    16.     MyCaption = Me.Caption
    17.     If MyCaption = "" Then Exit Sub
    18.         For i = 0 To Len(MyCaption)
    19.             LastCaptionChar = Right(MyCaption, 1)
    20.             Me.Caption = LastCaptionChar & Left(MyCaption, Len(MyCaption) - 1)
    21.         Next
    22. End Sub
    23.  
    24. 'to change how the text scrolls at run time
    25. Private Sub Command1_Click()
    26. Timer1.Enabled = False
    27. Timer2.Enabled = True
    28. End Sub
    29.  
    30. 'to scroll only if the form is minimized
    31. Private Sub Form_Resize()
    32. If Me.WindowState = vbMinimized Then
    33.    Timer1.Enabled = True
    34. Else
    35.    Timer1.Enabled = False
    36.    Me.Caption = "  Scrolling Window Caption Form  "
    37. End If
    38. End Sub

  5. #5

    Thread Starter
    Frenzied Member SeanK's Avatar
    Join Date
    May 2002
    Location
    Boston MA
    Posts
    1,160
    Works great Hack, except that it only scrolls the length of the window caption text. Can I get it to scroll the entire length of the caption title bar regardless of the length of the text?
    Beantown Boy
    Please use [highlight=vb]your code goes in here[/highlight] tags when posting code.
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Lengthen the window caption with spaces.

  7. #7

    Thread Starter
    Frenzied Member SeanK's Avatar
    Join Date
    May 2002
    Location
    Boston MA
    Posts
    1,160
    Ok...
    Beantown Boy
    Please use [highlight=vb]your code goes in here[/highlight] tags when posting code.
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.

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