CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2006
    Posts
    344

    Continuously updating tool tips

    Is there a correct way of continuously updating tool-tips?

    I've got a graph which is constantly updating and scrolling from right to left. The OnMouseMove sets a trackmouseevent to fire on hover and also causes the tooltip to be activate and to initially generate the tool tip. The OnHover function also causes the function that updates the tooltip with the correct text. The text updates quickly while the mouse is moving.

    However the Tool Tip doesn't activate like I planned it when hovering. Instead it updates every few seconds with a burst of activity - two or three updates in quick succession but ~3 seconds with no updates. How can I make it quickly update whatever is under the mouse even if the mouse is still?

    Other info:
    Currently I have a TRACKMOUSEEVENT structure set every time it enters OnMouseMove and the delay is set to 1 millisecond. Changing this has no effect.

    The tool tip class has been extended to allow for tracking tooltips.

    Both OnMouseMove and OnMouseHover call the same function that generates the correct text for the tooltip.

    Thanks.

  2. #2
    Join Date
    Apr 1999
    Posts
    3,585

    Re: Continuously updating tool tips

    You might benefit from utilizing the technique that Dino Esposito describes in his MSDN article .
    Gort...Klaatu, Barada Nikto!

  3. #3
    Join Date
    Jan 2006
    Posts
    344

    Re: Continuously updating tool tips

    Okay. Thinking about it overnight, I've come to the conclusion that I maybe looking at it from the wrong angle.

    The graph updates based on the OnTimer function call. Therefore I should update the tool tip there too. I added a member variable to CToolTipCtrlEx so I knew if I was tracking or not. I then used GetCursorPos to get the position of the mouse in OnTimer - no need to check if I was in the control since I was tracking if it was active or not.

    This works like I wanted it to, though dragging causes the blobby box effect until the trace updates (set to 40ms).

    Also can't get the transparency to work, and the box resizes itself as the numbers change but apart from that I am fairly happy with it.

    G.
    Last edited by grahamr (work); July 31st, 2008 at 08:13 AM.

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