Results 1 to 6 of 6

Thread: Easy Status Bar Question

  1. #1

    Thread Starter
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    This may be a cheesy question, but how do I enable all my controls tool tips to appear in my status bar?? I thought all i had to do was change a few properties, but it's not working..thanks

  2. #2
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276
    This is the only way I know how:

    Code:
    Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    
        StatusBar1.Panels(1) = Command1.ToolTipText
        
    End Sub
    
    Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    
        StatusBar1.Panels(1) = ""
    
    End Sub
    'Panels(1)' refers to the default panel. You can add more though.

  3. #3
    Lively Member
    Join Date
    Feb 2000
    Posts
    118

    control array

    put as many controls as you can into arrays to shorten the code wey97 gave you.
    Code:
    Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
        StatusBar1.Panels(1) = Command1.ToolTipText
    End Sub
    Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
        StatusBar1.Panels(1) = ""
    End Sub
    Private Sub Text1_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
        StatusBar1.Panels(1).Text = Text1(Index).ToolTipText
    End Sub
    Kokopeli
    VB6 SP3

  4. #4
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276


    I don't bake your cake and eat it for you too kokopeli.


  5. #5
    Fanatic Member ExcalibursZone's Avatar
    Join Date
    Feb 2000
    Location
    Western NY State
    Posts
    908
    I was sitting here thinking (and doing some tests) ... If you set up Timer or find a way to check when your mouse pointer is over a control make the status bar equal the tooltiptext of the control.

    Now, if you do a search for "mousemove api" (without the quotes) here on VB-World, you'll find a nifty piece of code that will allow you to make the font of a label bold or normal if the mouse pointer is over it.

    I modified this a bit to iterate through controls on the form and display the tooltiptext on the statusbar. I ran into some problems: The statusbar would continually update and create a flicker effect. Otherwise it worked fine.

    If anyone else can help out and modify that code to allow for this function to work, that'd be snifty.

    It basically uses the api to check where the mousepointer is on the form. It utilizes a timer to constantly check against the controls on the form. The timer checks to see where the mouse pointer is in relation to each control in form1.controls, if it falls in the specs for a control, and the control has a tooltip, then it will display it, otherwise, it displays nothing.

    Hope this gives you ideas to get you going in the right direction, without having to code the mousemove of every control that is
    -Excalibur

  6. #6

    Thread Starter
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496

    thanks

    thanks for all the suggestions, i will try them in my program.

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