Zuordnen von Add-In-Befehlen zu Tasten
Aktualisiert: November 2007
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 Tastenkombinationen.
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 diesem Abschnitt
Parameterformat der Bindings-Eigenschaft
Outlines the parameters used by the Bindings property and how they affect key binding.Gewusst wie: Anzeigen vorhandener Tastaturzuordnungen
Provides code that enables you to view the existing key bindings.Gewusst wie: Zuordnen eines Befehls zu einer einzelnen Tastenkombination
Demonstrates how to bind a command to a single shortcut key.Gewusst wie: Zuordnen eines Befehls zu mehreren Tastenkombinationen
Demonstrates how to bind a command to a multi-key shortcut.Gewusst wie: Beibehalten vorhandener Tastenzuordnungen für Befehle
Demonstrates how to add new key bindings while preserving existing ones.
Verwandte Abschnitte
Anzeigen von Add-Ins auf Symbolleisten und in Menüs
Explains how to display add-in commands on Visual Studio toolbars and menus.Tastenkombinationen
Explains how to create shortcut keys in Visual Studio.