Share via


IMenuCommandService.ShowContextMenu(CommandID, Int32, Int32) 方法

定义

在指定位置显示指定的快捷菜单。

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

参数

menuID
CommandID

要显示的快捷菜单的 CommandID

x
Int32

屏幕上的 x 坐标,菜单此处显示。

y
Int32

屏幕上的 y 坐标,菜单此处显示。

注解

方法 ShowContextMenu 可以在指定点显示包含菜单命令的以下任何 Visual Studio 快捷菜单:

菜单 CommandID
为容器显示的快捷菜单 ContainerMenu
为组件托盘显示的快捷菜单 ComponentTrayMenu
为所选内容显示的快捷菜单 SelectionMenu
为托盘选择显示的快捷菜单 TraySelectionMenu

此方法还可以显示其他已注册的快捷菜单。

适用于

另请参阅