IMenuCommandService.ShowContextMenu(CommandID, Int32, Int32) 方法
定义
在指定位置显示指定的快捷菜单。Shows the specified shortcut menu at the specified location.
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)
参数
- x
- Int32
屏幕上的 x 坐标,菜单此处显示。The x-coordinate at which to display the menu, in screen coordinates.
- y
- Int32
屏幕上的 y 坐标,菜单此处显示。The y-coordinate at which to display the menu, in screen coordinates.
注解
此 ShowContextMenu 方法可以显示以下任何 Visual Studio 快捷菜单,其中包含位于指定点的菜单命令:The ShowContextMenu method can display any of the following Visual Studio shortcut menus containing menu commands at a specified point:
| 菜单Menu | CommandIDCommandID |
|---|---|
| 为容器显示的快捷菜单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.