Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Showing a tooltip for a MenuItem

Tags:

.net

winforms

I've got a menu that contains, among other things, some most-recently-used file paths. The paths to these files can be long, so the text sometimes gets clipped like "C:\Progra...\foo.txt"

I'd like to pop a tooltip with the full path when the user hovers over the item, but this doesn't seem possible with the Tooltip class in .NET 2.0.

Am I missing something obvious?

like image 313
Chris Karcher Avatar asked Sep 12 '08 03:09

Chris Karcher


1 Answers

If you are creating your menu items using the System.Windows.Forms.MenuItem class you won't have a "ToolTipText" property.

You should use the System.Windows.Forms.ToolStripMenuItem class which is new as of .Net Framework 2.0 and DOES include the "ToolTipText" property.

You also have to remember to specify ShowItemToolTips = True on the MenuStrip control

like image 132
Adrian Clark Avatar answered Oct 15 '22 21:10

Adrian Clark