Visual Studio shortcut keys

来源:互联网 发布:java代码模拟http请求 编辑:程序博客网 时间:2024/05/21 18:31

The following content is from http://www.dofactory.com/ShortCutKeys/ShortCutKeys.aspx

==============================================================================


You are familiar with many of Visual Studio's shortcut keys, but not all of them. Here is a handy reference that can make your .NET lifestyle easier and a lot more productive. The 'must-know' shortcut keys arehighlighted.

 


Select a category

 General Text navigation Text manipulation Text selection Project related Window manipulation Control editor (designer) Search and replace Help Debugging Object browser Tool window Html designer Macro 



General

ShortcutDescriptionCtrl-X or
Shift-Delete
Cuts the currently selected item to the clipboardCtrl-C or
Ctrl-Insert
Copies the currently selected item to the clipboardCtrl-V or
Shift-Insert
Pastes the item in the clipboard at the cursorCtrl-Z or
Alt-Backspace
Undo previous editing actionCtrl-Y or
Ctrl-Shift-Z
Redo the previous undo actionCtrl-Shift-V or
Ctrl-Shift-Insert
Pastes an item from the clipboard ring tab of the Toolbox at the cursor in the file and automatically selects the pasted item. Cycle through the items on the clipboard by pressing the shortcut keys repeatedlyEsc
Closes a menu or dialog, cancels an operation in progress, or places focus in the current document windowCtrl-S
Saves the selected files in the current project (usually the file that is being edited)Ctrl-Shift-S
Saves all documents and projectsCtrl-P
Displays the Print dialogF7
Switches from the design view to the code view in the editorShift-F7
Switches from the code view to the design view in the editorF8
Moves the cursor to the next item, for example in the TaskList window or Find Results windowShift-F8
Moves the cursor to the previous item, for example in the TaskList window or Find Results windowShift-F12
Finds a reference to the selected item or the item under the cursorCtrl-Shift-G
Opens the file whose name is under the cursor or is currently selectedCtrl-/
Switches focus to the Find/Command box on the Standard toolbarCtrl-Shift-F12
Moves to the next task in the TaskList windowCtrl-Shift-8
Moves backward in the browse history. Available in the object browser or Class View windowAlt-Left Arrow
Go back in the web browser historyAlt-Right Arrow
Go forward in the web browser history

return to top



Text navigation

ShortcutDescriptionLeft Arrow
Moves the cursor one character to the leftRight Arrow
Moves the cursor one character to the rightDown Arrow
Moves the cursor down one lineUp Arrow
Moves the cursor up one linePage Down
Scrolls down one screen in the editor windowPage Up
Scrolls up one screen in the editor windowEnd
Moves the cursor to the end of the current lineHome
Moves the cursor to the beginning of the line. If you press Home when the cursor is already at the start of the line, it will toggle the cursor between the first non-whitespace character and the real start of the lineCtrl-End
Moves the cursor to the end of the documentCtrl-Home
Moves the cursor to the start of the documentCtrl-G
Displays the Go to Line dialog. If the debugger is running, the dialog also lets you specify addresses or function names to go toCtrl-]
Moves the cursor to the matching brace in the document. If the cursor is on an opening brace, this will move to the corresponding closing brace and vice versaCtrl-K, Ctrl-N
Moves to the next bookmark in the documentCtrl-K, Ctrl-P
Moves to the previous bookmarkCtrl-K, Ctrl-I
Displays Quick Info, based on the current languageCtrl-Down Arrow
Scrolls text down one line but does not move the cursor. This is useful for scrolling more text into view without losing your place. Available only in text editorsCtrl-Up Arrow
Scrolls text up one line but does not move the cursor. Available only in text editorsCtrl-Right Arrow
Moves the cursor one word to the rightCtrl-Left Arrow
Moves the cursor one word to the leftCtrl-Shift-1
Navigates to the next definition, declaration, or reference of an item. Available in the object browser and Class View window. Also available in source editing windows if you have already used the Edit.GoToReference (Shift-F12) shortcutCtrl-Shift-2
Navigates to the previous definition, declaration, or reference of an item

return to top



Text manipulation

ShortcutDescriptionEnter
Inserts a new lineDelete
Deletes one character to the right of the cursorInsert
Toggles between insert and overtype insertion modesTab
Indents the currently selected line or lines by one tab stop. If there is no selection, this inserts a tab stopShift-Tab
Moves current line or selected lines one tab stop to the leftBackspace or
Shift-Backspace
Deletes one character to the left of the cursorCtrl-K, Ctrl-C
Marks the current line or selected lines of code as a comment, using the correct comment syntax for the programming languageCtrl-K, Ctrl-U
Removes the comment syntax from the current line or currently selected lines of codeCtrl-T or
Shift-Enter
Swaps the characters on either side of the cursor. (For example, AC|BD becomes AB|CD.) Available only in text editorsCtrl-K, Ctrl-L
Removes all unnamed bookmarks in the current documentCtrl-M, Ctrl-O
Automatically determines logical boundaries for creating regions in code, such as procedures, and then hides them. This collapses all such regions in the current documentAlt-Right Arrow or
Ctrl-Spacebar
Displays statement completion based on the current language or autocompletes word if existing text unambiguously identifies a single symbolCtrl-K, Ctrl-\
Removes horizontal whitespace in the selection or deletes whitespace adjacent to the cursor if there is no selectionCtrl-K, Ctrl-F
Applies the indenting and space formatting for the language as specified on the Formatting pane of the language in the Text Editor section of the Options dialog to the selected text.Ctrl-L
Cuts all selected lines or the current line if nothing has been selected to the clipboardCtrl-Shift-L
Deletes all selected lines or the current line if no selection has been madeCtrl-Enter
Inserts a blank line above the cursorCtrl-Shift-Enter
Inserts a blank line below the cursorShift-Alt-T
Moves the line containing the cursor below the next lineCtrl-J
Lists members for statement completion when editing codeCtrl-U
Changes the selected text to lowercase charactersCtrl-Shift-UChanges the selected text to uppercase charactersCtrl-Shift-Spacebar
Displays a tooltip that contains information for the current parameter, based on the current languageCtrl-M, Ctrl-U
Removes the outlining information for the currently selected regionCtrl-M, Ctrl-P
Removes all outlining information from the entire documentCtrl-R, Ctrl-P
Swaps the anchor and endpoint of the current selectionCtrl-M, Ctrl-L
Toggles all previously marked hidden text sections between hidden and display statesCtrl-K, Ctrl-K
Sets or removes a bookmark at the current lineCtrl-M, Ctrl-M
Toggles the currently selected hidden text section or the section containing the cursor if there is no selection between the hidden and display statesCtrl-K, Ctrl-H
Sets or removes a shortcut in the tasklist to the current lineCtrl-R, Ctrl-R
Enables or disables word wrap in an editorCtrl-R, Ctrl-W
Shows or hides spaces and tab marksCtrl-Delete
Deletes the word to the right of the cursorCtrl-Backspace
Deletes the word to the left of the cursorCtrl-Shift-T
Transposes the two words that follow the cursor. (For example, |End Sub would be changed to read Sub End|.)Ctrl-.[dot]Display options on smarttag menu.
Very useful for showing using/Imports options.

return to top



Text selection

ShortcutDescriptionShift-Left Arrow
Moves the cursor to the left one character, extending the selectionShift-Alt-Left Arrow
Moves the cursor to the left one character, extending the column selectionShift-Right Arrow
Moves the cursor to the right one character, extending the selectionShift-Alt-Right Arrow
Moves the cursor to the right one character, extending the column selectionCtrl-Shift-End
Moves the cursor to the end of the document, extending the selectionCtrl-Shift-Home
Moves the cursor to the start of the document, extending the selectionCtrl-Shift-]
Moves the cursor to the next brace, extending the selectionShift-Down Arrow
Moves the cursor down one line, extending the selectionShift-Alt-Down Arrow
Moves the cursor down one line, extending the column selectionShift-End
Moves the cursor to the end of the current line, extending the selectionShift-Alt-End
Moves the cursor to the end of the line, extending the column selectionShift-Home
Moves the cursor to the start of the line, extending the selectionShift-Alt-Home
Moves the cursor to the start of the line, extending the column selectionShift-Up Arrow
Moves the cursor up one line, extending the selectionShift-Alt-Up Arrow
Moves the cursor up one line, extending the column selectionShift-Page Down
Extends selection down one pageShift-Page Up
Extends selection up one pageCtrl-A
Selects everything in the current documentCtrl-W
Selects the word containing the cursor or the word to the right of the cursorCtrl-=
Selects from the current location in the editor back to the previous location in the navigation historyCtrl-Shift-Page Down
Moves the cursor to the last line in view, extending the selectionCtrl-Shift-Page Up
Moves the cursor to the top of the current window, extending the selectionCtrl-Shift-Alt-Right Arrow
Moves the cursor to the right one word, extending the column selectionCtrl-Shift-Left Arrow
Moves the cursor one word to the left, extending the selectionCtrl-Shift-Alt-Left Arrow
Moves the cursor to the left one word, extending the column selection

return to top



Project related

ShortcutDescriptionCtrl-Shift-B
Builds the solutionCtrl-N
Displays the New File dialog. Note: files created this way are not associated with a project. Use Ctrl-Shift-A to add a new file in a projectCtrl-Shift-N
Displays the New Project dialogCtrl-O
Displays the Open File dialogCtrl-Shift-O
Displays the Open Project dialogShift-Alt-A
Displays the Add Existing Item dialogCtrl-Shift-A
Displays the Add New Item dialogCtrl-Alt-Insert
Allows you to override base class methods in a derived class when an overridable method is highlighted in the Class View pane

return to top



Window manipulation

ShortcutDescriptionShift-Alt-Enter
Toggles full screen modeCtrl-+
Goes back to the previous location in the navigation history. (For example, if you press Ctrl-Home to go to the start of a document, this shortcut will take the cursor back to wherever it was before you pressed Ctrl-Home.)Ctrl-Shift-+
Moves forward in the navigation history. This is effectively an undo for the View.NavigateBackward operationCtrl-F4
Closes the current MDI child windowShift-Esc
Closes the current tool windowCtrl-F2
Moves the cursor to the navigation bar at the top of a code viewCtrl-Tab
Cycles through the MDI child windows one window at a timeCtrl-F6,
Ctrl-Shift-Tab
Moves to the previous MDI child windowAlt-F6,
Ctrl-Shift-F6
Moves to the next tool windowShift-Alt-F6
Moves to the previously selected windowF6
Moves to the next pane of a split pane view of a single documentShift-F6
Moves to the previous pane of a document in split pane viewCtrl-Pagedown
Moves to the next tab in the document or window (e.g., you can use this to switch the HTML editor from its design view to its HTML viewCtrl-PageUp
Moves to the previous tab in the document or window

return to top



Control editor (designer)

ShortcutDescriptionCtrl-Down Arrow
Moves the selected control down in increments of one on the design surface
Down Arrow
Moves the selected control down to the next grid position on the design surfaceCtrl-Left Arrow
Moves the control to the left in increments of one on the design surfaceLeft Arrow
Moves the control to the left to the next grid position on the design surfaceCtrl-Right Arrow
Moves the control to the right in increments of one on the design surfaceRight Arrow
Moves the control to the right into the next grid position on the design surfaceCtrl-Up Arrow
Moves the control up in increments of one on the design surfaceUp Arrow
Moves the control up into the next grid position on the design surfaceTab
Moves to the next control in the tab orderShift-Tab
Moves to the previous control in the tab orderCtrl-Shift-Down Arrow
Increases the height of the control in increments of one on the design surfaceShift-Down Arrow
Increases the height of the control to the next grid position on the design surfaceCtrl-Shift-Left Arrow
Reduces the width of the control in increments of one on the design surfaceShift-Left Arrow
Reduces the width of the control to the next grid position on the design surfaceCtrl-Shift-Right Arrow
Increases the width of the control in increments of one on the design surfaceShift-Left Arrow
Increases the width of the control to the next grid position on the design surfaceCtrl-Shift-Up Arrow
Decreases the height of the control in increments of one on the design surfaceShift-Up Arrow
Decreases the height of the control to the next grid position on the design surface

return to top



ShortcutDescriptionCtrl-F
Displays the Find dialogCtrl-Shift-F
Displays the Find in Files dialogF3
Finds the next occurrence of the previous search textCtrl-F3
Finds the next occurrence of the currently selected text or the word under the cursor if there is no selectionShift-F3
Finds the previous occurrence of the search textCtrl-Shift-F3
Finds the previous occurrence of the currently selected text or the word under the cursorCtrl-D
Places the cursor in the Find/Command line on the Standard toolbarAlt-F3, H
Selects or clears the Search Hidden Text option for the Find dialogCtrl-I
Starts an incremental search—after pressing Ctrl-I, you can type in text, and for each letter you type, VS.NET will find the first occurrence of the sequence of letters you have typed so far. This is a very convenient facility, as it lets you find text by typing in exactly as many characters as are required to locate the text and no more. If you press Ctrl-I a second time without typing any characters, it recalls the previous pattern. If you press it a third time or you press it when an incremental search has already found a match, VS.NET searches for the next occurrence.Alt-F3, C
Selects or clears the Match Case option for Find and Replace operationsAlt-F3, R
Selects or clears the Regular Expression option so that special characters can be used in Find and Replace operationsCtrl-H
Displays the Replace dialogCtrl-Shift-H
Displays the Replace in Files dialogCtrl-Shift-I
Performs an incremental search in reverse directionAlt-F3, S
Halts the current Find in Files operationAlt-F3, B
Selects or clears the Search Up option for Find and Replace operationsAlt-F3, W
Selects or clears the Match Whole Word option for Find and Replace operationsAlt-F3, P
Selects or clears the Wildcard option for Find and Replace operations

return to top



Help

ShortcutDescriptionCtrl-Alt-F1
Displays the Contents window for the documentationCtrl-F1
Displays the Dynamic Help window, which displays different topics depending on what items currently have focus. If the focus is in a source window, the Dynamic Help window will display help topics that are relevant to the text under the cursorF1
Displays a topic from Help that corresponds to the part of the user interface that currently has the focus. If the focus is in a source window, Help will try to display a topic relevant to the text under the cursorCtrl-Alt-F2
Displays the Help Index windowShift-Alt-F2
Displays the Index Results window, which lists the topics that contain the keyword selected in the Index windowAlt-Down Arrow
Displays the next topic in the table of contents. Available only in the Help browser windowAlt-Up Arrow
Displays the previous topic in the table of contents. Available only in the Help browser windowCtrl-Alt-F3
Displays the Search window, which allows you to search for words or phrases in the documentationShift-Alt-F3
Displays the Search Results window, which displays a list of topics that contain the string searched for from the Search window.Shift-F1
Displays a topic from Help that corresponds to the user interface item that has the focus

return to top



Debugging

ShortcutDescriptionCtrl-Alt-V, A
Displays the Auto window to view the values of variables currently in the scope of the current line of execution within the current procedureCtrl-Alt-Break
Temporarily stops execution of all processes in a debugging session. Available only in run modeCtrl-Alt-B
Displays the Breakpoints dialog, where you can add and modify breakpointsCtrl-Alt-C
Displays the Call Stack window to display a list of all active procedures or stack frames for the current thread of execution. Available only in break modeCtrl-Shift-F9
Clears all of the breakpoints in the projectCtrl-Alt-D
Displays the Disassembly windowCtrl-F9
Enables or disables the breakpoint on the current line of code. The line must already have a breakpoint for this to workCtrl-Alt-E
Displays the Exceptions dialogCtrl-Alt-I
Displays the Immediate window, where you can evaluate expressions and execute individual commandsCtrl-Alt-V, L
Displays the Locals window to view the variables and their values for the currently selected procedure in the stack frameCtrl-Alt-M, 1
Displays the Memory 1 window to view memory in the process being debugged. This is particularly useful when you do not have debugging symbols available for the code you are looking at. It is also helpful for looking at large buffers, strings, and other data that does not display clearly in the Watch or Variables windowCtrl-Alt-M, 2
Displays the Memory 2 windowCtrl-Alt-M, 3
Displays the Memory 3 windowCtrl-Alt-M, 4
Displays the Memory 4 windowCtrl-Alt-U
Displays the Modules window, which allows you to view the .dll or .exe files loaded by the program. In multiprocess debugging, you can right-click and select Show Modules for all programsCtrl-B
Opens the New Breakpoint dialogCtrl-Alt-Q
Displays the Quick Watch dialog with the current value of the selected expression. Available only in break mode. Use this command to check the current value of a variable, property, or other expression for which you have not defined a watch expressionCtrl-Alt-G
Displays the Registers window, which displays CPU register contentsCtrl-Shift-F5
Terminates the current debugging session, rebuilds if necessary, and then starts a new debugging session. Available in break and run modesCtrl-Alt-N
Displays the Running Documents window that displays the set of HTML documents that you are in the process of debugging. Available in break and run modesCtrl-F10
Starts or resumes execution of your code and then halts execution when it reaches the selected statement. This starts the debugger if it is not already runningCtrl-Shift-F10
Sets the execution point to the line of code you chooseAlt-NUM *
Highlights the next statement to be executedF5
If not currently debugging, this runs the startup project or projects and attaches the debugger. If in break mode, this allows execution to continue (i.e., it returns to run mode).Ctrl-F5
Runs the code without invoking the debugger. For console applications, this also arranges for the console window to stay open with a "Press any key to continue" prompt when the program finishesF11
Executes code one statement at a time, tracing execution into function callsShift-F11
Executes the remaining lines of a function in which the current execution point liesF10
Executes the next line of code but does not step into any function callsShift-F5
Available in break and run modes, this terminates the debugging sessionCtrl-Alt-V, T
Displays the This window, which allows you to view the data members of the object associated with the current methodCtrl-Alt-H
Displays the Threads window to view all of the threads for the current processF9
Sets or removes a breakpoint at the current lineCtrl-F11
Displays the disassembly information for the current source file. Available only in break modeCtrl-Alt-W, 1
Displays the Watch 1 window to view the values of variables or watch expressionsCtrl-Alt-W, 2
Displays the Watch 2 windowCtrl-Alt-W, 3
Displays the Watch 3 windowCtrl-Alt-W, 4
Displays the Watch 4 windowCtrl-Alt-P
Displays the Processes dialog, which allows you to attach or detach the debugger to one or more running processes

return to top



Object browser

ShortcutDescriptionAlt-F12
Displays the Find Symbol dialogCtrl-F12
Displays the declaration of the selected symbol in the codeF12
Displays the definition for the selected symbol in codeCtrl-Alt-F12
Displays the Find Symbol Results windowCtrl-Alt-J
Displays the Object Browser to view the classes, properties, methods, events, and constants defined either in your project or by components and type libraries referenced by your projectAlt-+
Moves back to the previously selected object in the selection history of the object browserShift-Alt-+
Moves forward to the next object in the selection history of the object browser

return to top



Tool window

ShortcutDescriptionCtrl-Shift-M
Toggles the Command window into or out of a mode allowing text within the window to be selectedCtrl-Shift-C
Displays the Class View windowCtrl-Alt-A
Displays the Command window, which allows you to type commands that manipulate the IDECtrl-Alt-T
Displays the Document Outline window to view the flat or hierarchical outline of the current documentCtrl-Alt-F
Displays the Favorites window, which lists shortcuts to web pagesCtrl-Alt-O
Displays the Output window to view status messages at runtimeF4
Displays the Properties window, which lists the design-time properties and events for the currently selected itemShift-F4
Displays the property pages for the item currently selected. (For example, use this to show a project's settings.)Ctrl-Shift-E
Displays the Resource View windowCtrl-Alt-S
Displays the Server Explorer window, which allows you to view and manipulate database servers, event logs, message queues, web services, and many other operating system servicesCtrl-Alt-R
Displays the web browser window, which allows you to view pages on the InternetCtrl-Alt-L
Displays the Solution Explorer, which lists the projects and files in the current solutionCtrl-Alt-K
Displays the TaskList window, which displays tasks, comments, shortcuts, warnings, and error messagesCtrl-Alt-X
Displays the Toolbox, which contains controls and other items that can be dragged into editor and designer windows

return to top



Html editor (Design View)

ShortcutDescriptionCtrl-B
Toggles the selected text between bold and normalCtrl-Shift-T
Decreases the selected paragraph by one indent unitCtrl-T
Indents the selected paragraph by one indent unitCtrl-I
Toggles the selected text between italic and normalCtrl-Shift-K
Prevents an absolutely positioned element from being inadvertently moved. If the element is already locked, this unlocks itCtrl-G
Toggles the gridCtrl-Shift-G
Specifies that elements be aligned using an invisible grid. You can set grid spacing on the Design pane of HTML designer options in the Options dialog, and the grid will be changed the next time you open a documentCtrl-U
Toggles the selected text between underlined and normalCtrl-Shift-L
Displays the Bookmark dialogCtrl-J
Inserts <div></div> in the current HTML documentCtrl-L
When text is selected, displays the Hyperlink dialogCtrl-Shift-W
Displays the Insert Image dialogCtrl-Alt-Up Arrow
Adds one row above the current row in the tableCtrl-Alt-Down Arrow
Adds one row below the current row in the tableCtrl-Alt-Left Arrow
Adds one column to the left of the current column in the tableCtrl-Alt-Right Arrow
Adds one column to the right of the current column in the tableCtrl-Shift-Q
Toggles display of marker icons for HTML elements that do not have a visual representation, such as comments, scripts, and anchors for absolutely positioned elementsCtrl-Page Down
Switches from design view to HTML view and vice versaCtrl-Q
Displays a 1-pixel border around HTML elements that support a BORDER attribute and have it set to zero, such as tables, table cells, and divisions

return to top



Macro

ShortcutDescriptionAlt-F8
Displays the Macro Explorer window, which lists all available macrosAlt-F11
Launches the macros IDECtrl-Shift-R
Places the environment in macro record mode or completes recording if already in record modeCtrl-Shift-P
Plays back a recorded macro

原创粉丝点击