Windows Develop Bookmark and Share   
 index > Windows Forms General > show tooltip on a toolstripbutton
 

show tooltip on a toolstripbutton

hi all.

how can i set a tooltip, from a tooltip control on a ToolStripButton?

the SetToolTip method expect a Control, but the ToolStripButton isn't a control...

shimshon  Tuesday, December 19, 2006 1:07 PM

You can't. ToolStripItem (the base class of ToolStripButton) already provides its own internal tool tip. You should set the ToolTipText property instead. Also be sure to set ShowItemToolTips on the parent strip.

Michael Taylor - 12/19/06

TaylorMichaelL  Tuesday, December 19, 2006 2:49 PM

I am changing ToolStripButton.ToolTipText programatically in response to clicking the ToolStripButton (it toggles the value, e.g. show / hide). But, the tool tip shown only updates if I move the cursor away and then back again. If I leave the cursor where it is (over the ToolStripButton), the ToolTipText doesn't update. I've tried Invalidate() and several other hacks with no effect. Any ideas?

BrenoM  Wednesday, May 30, 2007 12:00 AM

Sorry no ideas on how do fix that but can you or anybody help with with the following:-

How can you change the appearance of the MenuStrip tooltips to the Balloon style?

Currently they only display the rectanglar box. All the other tooltips in my application use the Balloon (as I create my own ToolTip class and use SetToolTip()) but I cant seem to get the Menu to display balloon tooltips.. Please help its drving me mad...

Mark Earl Allan  Thursday, May 31, 2007 12:43 PM

You can move cursor programmatically, andtool tip textwill get updated:

Point currentPosition = System.Windows.Forms.Cursor.Position;

System.Windows.Forms.Cursor.Position = new Point(0, 0);

System.Windows.Forms.Cursor.Position = new Point(100, 100);

System.Windows.Forms.Cursor.Position = currentPosition;

I move cursor to (0, 0) and then to(100, 100) to make sure that this trick works when toolstrip button is in upper left corner and current cursor position is close to (0, 0).

-- Vladimir

Vladimir Khvostov  Wednesday, September 12, 2007 1:18 PM

Ingenious! It seems to need some minimum movement to trigger an update. For instance, this works too:

System.Windows.Forms.Cursor.Position = new Point(lastPosition.X - 70, lastPosition.Y - 70);

BrenoM  Thursday, September 13, 2007 12:44 AM

You can use google to search for other answers

Custom Search

More Threads

• Wait for event before continuing in method
• How to create an image grid? Please help!
• Outlook Express
• webpage aligment behavior in winforms
• Is it posible to copy the GridView data from the WebBrowser1 to the clipbord
• How to show Image instead of Text on DataGridViewButtonCell ?
• TreeView populate problem
• Managing HTTP session in VB
• Problem while clicking link(Win Forms)
• return control to main thread