Extend menus and commands
Applies to: Visual Studio Visual Studio for Mac
Note
This article applies to Visual Studio 2017. 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
Commands are the way you add actions and processes to Visual Studio. In most cases commands are displayed on menus or toolbars. The VSPackage project template shows how to implement a very basic command. For a slightly longer but still basic implementation, see Create an extension with a menu command.
For more information about Visual Studio commands, menus, and toolbars, see Commands, menus, and toolbars.
Commands, menus, and toolbars are defined in the .vsct file that is part of VSPackage projects. You can find information about the Visual Studio IDE and the .vsct file in How VSPackages add user interface elements.
The following topics explain how to add different kinds of commands, menus, and toolbars.
In this section
Add a menu to the Visual Studio menu bar Explains how to add a menu to the top Visual Studio menu bar.
Bind keyboard shortcuts to menu items Explains how to add a keyboard shortcut (such as CTRL + 3) to a menu item.
Add a submenu to a menu Explains how to add a submenu to the top menu.
Add a most recently used list to a submenu Explains how to add a Most Recently Used list.
Create reusable groups of buttons Describes how to group command items so that they can be included on multiple menus.
Add icons to menu commands Describes how to add an icon to a command on both a toolbar and a menu.
Change the text of a menu command Describes the use of the
TextChanges
flag to enable a menu item to be changed dynamically.Change the appearance of a command Describes how to dynamically enable or disable a command.
Update the user interface Describes how to force an update of the user interface to reflect recent changes.
Localize menu commands Explains how to localize menu commands.