![]() ![]() | ||
Context menus are those handy menus that pop up over controls, usually when you right-click them. They're called context menus because they appear over specific controls—that is, in the context of that control, and so can be tailored to that control. They're supported by the ContextMenu class, which has this class hierarchy:
Object MarshalByRefObject Component Menu ContextMenu
You can find the notable public properties of ContextMenu objects in Table 9.6, their notable methods in Table 9.7, and their notable events in Table 9.8.
Property |
Means |
---|---|
IsParent |
True if this menu contains any menu items. This property is read-only. |
MdiListItem |
Holds the MenuItem that is used to display a list of MDI child forms. |
MenuItems |
Holds the collection of MenuItem objects associated with the menu. |
SourceControl |
Holds the control that is displaying the shortcut menu. |
Method |
Means |
---|---|
GetContextMenu |
Gets the context menu that contains this menu. |
GetMainMenu |
Gets the MainMenu object that contains this menu. |
MergeMenu |
Merges the MenuItem objects of one menu with the another menu. |
Show |
Displays the shortcut menu. |
Event |
Means |
---|---|
Popup |
Occurs before the context menu is displayed. |
![]() ![]() | ||