Class ContextMenu
Represents the context menu.
[ControlCategory("MenusAndToolbars")]
public class ContextMenu : Menu, IBaseObject, IDisposableObject, ISupportInitialize, IFocusable, ITextProperty, IComponent, IControl, IDisposable, IWin32Window, INotifyDataErrorInfo
- Inheritance
-
ContextMenu
- Implements
- Derived
Remarks
The ContextMenu class represents shortcut menus that can be displayed when the user clicks the right mouse button over a control or area of the form. Shortcut menus are typically used to combine different menu items from a MainMenu of a form that are useful for the user given the context of the application. For example, you can use a shortcut menu assigned to a TextBox control to provide menu items for changing the font of the text, finding text within the control, or Clipboard features for copying and pasting text. You can also display new MenuItem objects in a shortcut menu that are not located within a MainMenu to provide situation specific commands that are not appropriate for the MainMenu to display.
Constructors
- ContextMenu()
Initializes a new instance of the ContextMenu class.
Properties
- ControlKind
Returns control identifier.
- Enabled
This property has no meaning.
- Handler
Gets handler.
- ToolTip
This property has no meaning.
- Visible
This property has no meaning.
Methods
- CreateHandler()
Creates a handler for the control.
- OnClosing(EventArgs)
Called when menu is closing.
- OnOpening(CancelEventArgs)
Called when menu is opening.
- RaiseClosing(EventArgs)
Raises the Closing event and OnClosing(EventArgs) method.
- RaiseOpening(CancelEventArgs)
Raises the Opening event and OnOpening(CancelEventArgs) method.
- Show(IControl, PointD?)
Displays the menu at the specified position.
Events
- Closing
Occurs when the control is closing.
- Opening
Occurs when the control is opening.