CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Dec 1999
    Location
    MD, USA
    Posts
    34

    Can I make the text in the Status Bar scroll ..............

    The messege being displayed on the status bar is long and I dont want the font to be too small. Is there any way to make the messege scroll across ? ? ?

    Any help is appreciated.

    Thanks!


  2. #2
    Join Date
    Sep 1999
    Location
    Red Wing, MN USA
    Posts
    312

    Re: Can I make the text in the Status Bar scroll ..............

    Place a Timer Control on Your Form..

    private Sub Form_Load()
    'Use Timer to do the Scrolling..
    Timer1.Interval = 100
    'set the Status Panel Message..
    StatusBar1.Panels(1) = "Code Guru.. Where you'll find ALL the answers.."
    'Make sure the Tag is empty
    StatusBar1.Panels(1).Tag = ""
    End Sub

    private Sub Timer1_Timer()
    With StatusBar1.Panels(1)
    'If the Tag is empty, it's the Beginning of the Scroll
    If .Tag = "" then
    'Format the Text to make the Scroll Smooth
    'Insert Spaces to Start Scroll from Far Right of Panel
    .Tag = Space(.Width / TextWidth(" ")) & .Text
    .Text = .Tag
    End If
    If len(.Text) then
    'While there's some Text, Show One Character Less on the Left
    'Give the Illusion of Scrolling to the Left
    .Text = mid$(.Text, 2)
    else
    'Reset the Text and Scroll Again.
    .Text = .Tag
    End If
    End With
    End Sub




    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]
    Aaron Young
    Senior Programmer Analyst (Red Wing Software)
    Certified AllExperts Expert

  3. #3
    Join Date
    Dec 1999
    Location
    MD, USA
    Posts
    34

    Re: Can I make the text in the Status Bar scroll ..............

    wow ! Works perfect.

    Thanks ! ! !


  4. #4
    Join Date
    Jul 1999
    Location
    Australia
    Posts
    39

    Re: Can I make the text in the Status Bar scroll ..............

    Hi Aaron,
    I tried out this example but i get an error message saying "Object Required" and it highlights this part

    StatusBar1.Panels(1) = "Code Guru.. Where you'll find ALL the answers.."

    Can you tell me what the problem is?
    I am New to Visual Basic


  5. #5
    Join Date
    Dec 1999
    Location
    MD, USA
    Posts
    34

    Re: Can I make the text in the Status Bar scroll ..............

    Have you placed a Status Bar object on your form ?


  6. #6
    Guest

    Re: Can I make the text in the Status Bar scroll ..............

    Hi Tina,
    I am new to Visual Basic so can you please tell me where to get the Status Bar control. I checked in the toolbox but i don't think it's there.
    Please Help cause i learn alot from you guys.
    thanks,
    Derek


  7. #7
    Join Date
    Jul 1999
    Location
    Australia
    Posts
    39

    Re: Can I make the text in the Status Bar scroll ..............

    Hi Tina,
    I am new to Visual Basic so can you please tell me where to get the Status Bar control. I checked in the toolbox but i don't think it's there.
    Please Help cause i learn alot from you guys.
    thanks,
    Derek


  8. #8
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: Can I make the text in the Status Bar scroll ..............

    In VB - right click on your 'toolbox' (or goto Project->Components menu) - then scrolldown and look for either :

    - Microsoft Common Controls 5.0.... (if you have VB5)

    or

    - Microsoft Common Controls 6.0 ... (for VB6)

    You'll then have access to the TreeView, ListView, ImageList, ProgressBar, StatusBar, Toolbar and a few others.

    Chris Eastwood

    CodeGuru - the website for developers
    http://codeguru.developer.com/vb

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

Featured