Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
ShowContextMenu Method

IMenuCommandService.ShowContextMenu Method

Shows the specified shortcut menu at the specified location.

Namespace: System.ComponentModel.Design
Assembly: System (in system.dll)

void ShowContextMenu (
	CommandID menuID,
	int x,
	int y
)
void ShowContextMenu (
	CommandID menuID, 
	int x, 
	int y
)
function ShowContextMenu (
	menuID : CommandID, 
	x : int, 
	y : int
)
Not applicable.

Parameters

menuID

The 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.

The ShowContextMenu method can display any of the following Visual Studio .NET 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.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2015 Microsoft