Condividi tramite


Binding Add-In Commands to Keys

Visual Studio add-ins are deprecated in Visual Studio 2013. You should upgrade your add-ins to VSPackage extensions. For more information about upgrading, see FAQ: Converting Add-ins to VSPackage Extensions.

In Visual Studio, you can associate (or "bind") one or more keyboard shortcuts to a command by selecting Options from the Tools menu and choosing the Keyboard page from the Environment folder. For example, rather than clicking the File menu, pointing to the Project command, and clicking the New command to create a new project, you can instead simply press the keyboard shortcut, CTRL+SHIFT+N. You can create or change keyboard shortcuts for any command in Visual Studio, including Visual Studio commands, macro commands, and add-in commands. For more information, see <PAVEOVER> Keyboard Shortcuts in Visual Studio.

In some cases, you might want to do this programmatically in your add-in rather than force your users to manually bind the keys themselves through the Options dialog box. You can do this by using the Bindings property of the Command object.

In This Section