IMenuCommandService.ShowContextMenu(CommandID, Int32, Int32) Method

Definition

Shows the specified shortcut menu at the specified location.

public void ShowContextMenu (System.ComponentModel.Design.CommandID menuID, int x, int y);

Parameters

menuID
CommandID

The CommandID for the shortcut menu to show.

x
Int32

The x-coordinate at which to display the menu, in screen coordinates.

y
Int32

The y-coordinate at which to display the menu, in screen coordinates.

Remarks

The ShowContextMenu method can display any of the following Visual Studio shortcut menus containing menu commands at a specified point:

Menu CommandID
The shortcut menu displayed for a container ContainerMenu
The shortcut menu displayed for the component tray ComponentTrayMenu
The shortcut menu displayed for a selection SelectionMenu
The shortcut menu displayed for a tray selection TraySelectionMenu

This method can also display other registered shortcut menus.

Applies to

Product Versies
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

See also