Connecting Tech Pros Worldwide Forums | Help | Site Map

c# refresh tooltip

Newbie
 
Join Date: Apr 2007
Posts: 17
#1: Aug 14 '07
Hi everyone,

I'm having a problem while using a button with a tooltip text.
The thing is I'd like the tooltip text to change if for example the button is clicked.

This works ok, yet the problem is that the new tooltip text is not updated until the mouse is moved away from the button and then repositioned on top of the button again.
This is unclear and not very nice to the user and it would be great if the tooltiptext could be refreshed imediately in one way or another, without the need to move the mouse between controls.

Unfortunaly there doesn't seem to be a refresh method within the tooltip control. But I think this has to be the answer. Does anyone maby know if there's a different way to get it refreshed?

P.S. Actually the problem also occures with the icons in the system tray..

Any help is greatly apreciated.
Michiel

Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,161
#2: Aug 14 '07

re: c# refresh tooltip


That's really out of the scope of tooltips at that point.
Tooltips are a "hover mouse, get short blip of info about what you're hovered over"
For the kind of functionality you are looking for you might want to create your own style of tool tip.

OR, possibly make wrapper functions for the existing tooltip that change it's timeout values to imediatly expire, then reset them again and force a re-pop of the tooltip.
Not sure if that will work, just a theory.
Newbie
 
Join Date: Apr 2007
Posts: 17
#3: Aug 15 '07

re: c# refresh tooltip


Ok, I'm pretty much a beginner in c#, but I'll try if I can manage something..
Maby it would be possible to create a new usercontrol and inherit the tooltip?

Thank you for your response and suggestions.
Newbie
 
Join Date: Dec 2007
Posts: 1
#4: Dec 19 '07

re: c# refresh tooltip


Once the button has been pressed, try making it invisible, clearing the tooltip text for the button, refreshing the parent control, setting the new tooltip text and making the button visible again.
Newbie
 
Join Date: Oct 2009
Posts: 1
#5: 4 Weeks Ago

re: c# refresh tooltip


Building on shapeideas message, I found that turning the button visibility off then on again was sufficient to force an update of the tooltip:

tool_bar_button.ToolTipText = "New Text";
tool_bar_button.Visible = false;
tool_bar_button.Visible = true;

It still has a small delay, however.
Reply