共用方式為


How to use the keyboard exclusively

Applies to: yesVisual Studio noVisual 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

Keyboard shortcuts can make it easier to navigate the Visual Studio IDE and to write code. This article explores a few ways you can use keyboard shortcuts more effectively.

For a full listing of command shortcut keys in Visual Studio, see Default keyboard shortcuts.

Tip

To learn more about accessibility updates, see the Accessibility improvements in Visual Studio 2017 blog post.

Note

Depending on your settings or the edition of Visual Studio you use, the dialog boxes and menu commands you see might differ from those described in Help. To change your settings, select Import and Export Settings on the Tools menu. For more information, see Reset settings.

Toolbox controls

To add a control on the Toolbox to a form or designer without using the mouse:

  1. On the menu bar, select View > Toolbox.

  2. Use the Ctrl+Up arrow or Ctrl+Down arrow keys to move among the sections in the Toolbox tab.

  3. Use the Up arrow key or Down arrow key to move among the controls in a section.

  4. After you select the control, use the Enter key to add the control to the form or designer.

Dialog box options

To move among the options in a dialog box and change option settings by using only the keyboard:

  1. Use Tab or Shift+Tab to move up and down through the controls in the dialog box.

  2. To change option settings:

    • For radio buttons, use the Up arrow and Down arrow keys to change the selection.

    • For check boxes, press Spacebar to select or unselect.

    • For drop-down lists, use Alt+Down arrow to display items, and then use the Up arrow and Down arrow keys to change the selected item.

    • For buttons, select Enter to invoke.

    • For grids, use the arrow keys to navigate. For drop-down lists in grids, use Shift+Alt+Down arrow to display items, and then use the Up arrow and Down arrow keys to change the selected item.

  • To move among files in an editor or designer, use the Ctrl+Tab keyboard shortcut to display the IDE Navigator with Active Files selected. Choose the Enter key to navigate to the highlighted file.

  • To move among docked tool windows, use the Alt+F7 keyboard shortcut to display the IDE Navigator with Active Tool Windows selected. Choose the Enter key to navigate to the highlighted window.

Move and dock tool windows

  1. Navigate to the tool window you intend to move and give it focus.

  2. On the Window menu, select the Dockable option.

  3. Press Alt+Spacebar, and then select Move.

    The docking guide diamond appears.

  4. Use the arrow keys to move the window to a new location.

    The mouse pointer moves with the window as you use the arrow keys.

  5. When you've reached the new location, use the arrow keys to move the mouse pointer over the correct portion of the guide diamond.

    An outline of the tool window appears in the new docking location.

  6. Press Enter.

    The tool window snaps into place at the new docking location.

See also