how can I add tooltip to MenuItem (in contextmenu?)

mcerk

Regular
Joined
Nov 1, 2004
Messages
78
Hi' I'd like to add a tooltip to MenuItem (member of ContextMenu)

how can I do that?

This code does not work (Value of type 'System.Windows.Forms.MenuItem' cannot be converted to 'System.Windows.Forms.Control'):

Visual Basic:
        Dim m As MenuItem = Me.ContextMenu1.MenuItems(0)
        Me.ToolTip1.SetToolTip(m, "blablabla")

tx,


matej
 
I don't know if you want a tooltip on menu items. Seems like too many things popping up. Describing what menu items do is generally done via the status bar. On the MenuItem.Select event you can put a tip in the status bar.
 
As far as I know there is no standard way of displaying a toolip from a context menuitem. Also, there are no events that would help display a help box. You could make your own control.
 
You write a class which implements IExtenderProvider and use it to link the tooltip to the menu item. Specifically in this case you subscribe to the Select event of the MenuItem and use that to set a specified Text property on another control. Its not so hard to implement once you've read around the subject of the componant model and IExtenderProvider a little, have a look.
 
Back
Top