Context Menus

Note

This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

Context menus are displayed when a user right-clicks in an active region of the client area and clear when the right mouse button is released.

Editor Context Menus

By intercepting ECMD_SHOWCONTEXTMENU, your language service can control the context menus that will display in the editor. To display your own context menu, handle this command when it is passed into your IOleCommandTarget by calling ShowContextMenu. If you do not handle this command, then the IDE displays a standard context menu provided for the editor. You can also control the content of the context menu on a per-marker basis. For more information about this, see Using Text Markers with the Legacy API and Intercepting Legacy Language Service Commands.

See Also

Developing a Legacy Language Service
Extending Menus and Commands