OleMenuCommandService.ShowContextMenu(CommandID, Int32, Int32) Method

Definition

Shows the shortcut menu with the given command ID at the given location.

public:
 override void ShowContextMenu(System::ComponentModel::Design::CommandID ^ menuID, int x, int y);
public override void ShowContextMenu (System.ComponentModel.Design.CommandID menuID, int x, int y);
abstract member ShowContextMenu : System.ComponentModel.Design.CommandID * int * int -> unit
override this.ShowContextMenu : System.ComponentModel.Design.CommandID * int * int -> unit
Public Overrides Sub ShowContextMenu (menuID As CommandID, x As Integer, y As Integer)

Parameters

menuID
CommandID

A command ID representing the shortcut menu to show.

x
Int32

The horizontal position, in screen coordinates, of the top, left corner of the shortcut menu. If the shortcut menu does not fit on the screen, the operating system relocates it to fit.

y
Int32

The vertical position, in screen coordinates, of the top, left corner of the shortcut menu. If the shortcut menu does not fit on the screen, the operating system relocates it to fit.

Exceptions

menuID is null.

Remarks

This method shows a shortcut menu that has been tagged with the given command ID at the given location. A shortcut menu is always tagged with a command ID that defines it. Coordinates are global to the screen.

Applies to