Represents a shortcut menu.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
replaces ContextMenu. You can associate a with any control, and a right mouse click automatically displays the shortcut menu. You can show a programmatically by using the Show method. supports cancelable Opening and Closing events to handle dynamic population and multiple-click scenarios. supports images, menu-item check state, text, access keys, shortcuts, and cascading menus.
The following items are specifically designed to work seamlessly with both ToolStripSystemRenderer and ToolStripProfessionalRenderer in all orientations. They are available by default at design time for the control:
Shortcut menus are typically used to combine different menu items from a MenuStrip 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 expose new ToolStripMenuItem objects in a shortcut menu that are not located within a MenuStrip to provide situation-specific commands that are inappropriate for the MenuStrip to display.
Typically, a shortcut menu is displayed when a user clicks the right mouse button over a control or the form itself. Many visible controls, as well as the Form itself, have a Control::ContextMenuStrip property that binds the class to the control that displays the shortcut menu. More than one control can use a .
Set the ToolStripDropDownMenu::ShowCheckMargin property to true to add space to the left of a ToolStripMenuItem for a check mark that shows that the menu item is enabled or selected. The ToolStripDropDownMenu::ShowImageMargin property is set to true by default. Use this space to the left of the ToolStripMenuItem to display an image for that menu item.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.