System.ComponentModel.Design.IMenuCommandService.ShowContextMenu Method

Shows the specified shortcut menu at the specified location.

Syntax

public void ShowContextMenu (CommandID menuID, int x, int y)

Parameters

menuID
The System.ComponentModel.Design.CommandID for the shortcut menu to show.
x
The x-coordinate at which to display the menu, in screen coordinates.
y
The y-coordinate at which to display the menu, in screen coordinates.

Remarks

The IMenuCommandService.ShowContextMenu(CommandID, int, int) method can display any of the following Visual Studio shortcut menus containing menu commands at a specified point:

The shortcut menu displayed for a container

System.Windows.Forms.Design.MenuCommands.ContainerMenu

The shortcut menu displayed for the component tray

System.Windows.Forms.Design.MenuCommands.ComponentTrayMenu

The shortcut menu displayed for a selection

System.Windows.Forms.Design.MenuCommands.SelectionMenu

The shortcut menu displayed for a tray selection

System.Windows.Forms.Design.MenuCommands.TraySelectionMenu

This method can also display other registered shortcut menus.

Requirements

Namespace: System.ComponentModel.Design
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0