Showing a tooltip for a MenuItem

前端 未结 6 1739
北恋
北恋 2021-01-17 11:25

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:\\

6条回答
  •  攒了一身酷
    2021-01-17 12:02

    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

提交回复
热议问题