Does anyone know how to scroll the caption of a window?
Printable View
Does anyone know how to scroll the caption of a window?
Do you mean like "Form1" in the window caption?
You want to scroll that across the window continously?
Yes sir, sir! :D
VB Code:
'to scroll right to left Private Sub Timer1_Timer() Me.Caption = " Scrolling Window Caption Form " MyCaption = Me.Caption If MyCaption = "" Then Exit Sub For i = 0 To Len(MyCaption) LastCaptionChar = Left(MyCaption, 1) Me.Caption = Mid(MyCaption, 2) & LastCaptionChar Next End Sub 'to scroll left to right Private Sub Timer2_Timer() Me.Caption = " Scrolling Window Caption Form " MyCaption = Me.Caption If MyCaption = "" Then Exit Sub For i = 0 To Len(MyCaption) LastCaptionChar = Right(MyCaption, 1) Me.Caption = LastCaptionChar & Left(MyCaption, Len(MyCaption) - 1) Next End Sub 'to change how the text scrolls at run time Private Sub Command1_Click() Timer1.Enabled = False Timer2.Enabled = True End Sub 'to scroll only if the form is minimized Private Sub Form_Resize() If Me.WindowState = vbMinimized Then Timer1.Enabled = True Else Timer1.Enabled = False Me.Caption = " Scrolling Window Caption Form " End If End Sub
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?
Lengthen the window caption with spaces.
Ok...:D