共用方式為


Context Menus

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 Language Service Commands.

See Also

Other Resources

Developing a Language Service

Common Tasks with Commands, Menus, and Toolbars