Viusal Studio 快捷键


Visual Studio shortcut keys


Here is a handy reference that can make your .NET lifestyle a bit easier and more productive.
The 'must-know' shortcut keys are Highlighted.





Select a category





General

ShortcutDescription
Ctrl-X or Shift-DeleteCuts the currently selected item to the clipboard
Ctrl-C or Ctrl-InsertCopies the currently selected item to the clipboard
Ctrl-V or Shift-InsertPastes the item in the clipboard at the cursor
Ctrl-Z or Alt-BackspaceUndo previous editing action
Ctrl-Y or Ctrl-Shift-ZRedo the previous undo action
Ctrl-Shift-V or Ctrl-Shift-InsertPastes 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 repeatedly
EscCloses a menu or dialog, cancels an operation in progress, or places focus in the current document window
Ctrl-SSaves the selected files in the current project (usually the file that is being edited)
Ctrl-Shift-SSaves all documents and projects
Ctrl-PDisplays the Print dialog
F7Switches from the design view to the code view in the editor
Shift-F7Switches from the code view to the design view in the editor
F8Moves the cursor to the next item, for example in the TaskList window or Find Results window
Shift-F8Moves the cursor to the previous item, for example in the TaskList window or Find Results window
Shift-F12Finds a reference to the selected item or the item under the cursor
Ctrl-Shift-GOpens the file whose name is under the cursor or is currently selected
Ctrl-/Switches focus to the Find/Command box on the Standard toolbar
Ctrl-Shift-F12Moves to the next task in the TaskList window
Ctrl-Shift-8Moves backward in the browse history. Available in the object browser or Class View window
Alt-Left ArrowGo back in the web browser history
Alt-Right ArrowGo forward in the web browser history





Text navigation

ShortcutDescription
Left ArrowMoves the cursor one character to the left
Right ArrowMoves the cursor one character to the right
Down ArrowMoves the cursor down one line
Up ArrowMoves the cursor up one line
Page DownScrolls down one screen in the editor window
Page UpScrolls up one screen in the editor window
EndMoves the cursor to the end of the current line
HomeMoves 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 line
Ctrl-EndMoves the cursor to the end of the document
Ctrl-HomeMoves the cursor to the start of the document
Ctrl-GDisplays the Go to Line dialog. If the debugger is running, the dialog also lets you specify addresses or function names to go to
Ctrl-]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 versa
Ctrl-K, Ctrl-NMoves to the next bookmark in the document
Ctrl-K, Ctrl-PMoves to the previous bookmark
Ctrl-K, Ctrl-IDisplays Quick Info, based on the current language
Ctrl-Down ArrowScrolls 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 editors
Ctrl-Up ArrowScrolls text up one line but does not move the cursor. Available only in text editors
Ctrl-Right ArrowMoves the cursor one word to the right
Ctrl-Left ArrowMoves the cursor one word to the left
Ctrl-Shift-1Navigates 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) shortcut
Ctrl-Shift-2Navigates to the previous definition, declaration, or reference of an item





Text manipulation

ShortcutDescription
EnterInserts a new line
DeleteDeletes one character to the right of the cursor
InsertToggles between insert and overtype insertion modes
TabIndents the currently selected line or lines by one tab stop. If there is no selection, this inserts a tab stop
Shift-TabMoves current line or selected lines one tab stop to the left
Backspace or Shift-BackspaceDeletes one character to the left of the cursor
Ctrl-K, Ctrl-CMarks the current line or selected lines of code as a comment, using the correct comment syntax for the programming language
Ctrl-K, Ctrl-URemoves the comment syntax from the current line or currently selected lines of code
Ctrl-T or Shift-EnterSwaps the characters on either side of the cursor. (For example, AC|BD becomes AB|CD.) Available only in text editors
Ctrl-K, Ctrl-LRemoves all unnamed bookmarks in the current document
Ctrl-M, Ctrl-OAutomatically determines logical boundaries for creating regions in code, such as procedures, and then hides them. This collapses all such regions in the current document
Alt-Right Arrow or Ctrl-SpacebarDisplays statement completion based on the current language or autocompletes word if existing text unambiguously identifies a single symbol
Ctrl-K, Ctrl-\Removes horizontal whitespace in the selection or deletes whitespace adjacent to the cursor if there is no selection
Ctrl-K, Ctrl-FApplies 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-LCuts all selected lines or the current line if nothing has been selected to the clipboard
Ctrl-Shift-LDeletes all selected lines or the current line if no selection has been made
Ctrl-EnterInserts a blank line above the cursor
Ctrl-Shift-EnterInserts a blank line below the cursor
Shift-Alt-TMoves the line containing the cursor below the next line
Ctrl-JLists members for statement completion when editing code
Ctrl-UChanges the selected text to lowercase characters
Ctrl-Shift-UChanges the selected text to uppercase characters
Ctrl-Shift-SpacebarDisplays a tooltip that contains information for the current parameter, based on the current language
Ctrl-M, Ctrl-URemoves the outlining information for the currently selected region
Ctrl-M, Ctrl-PRemoves all outlining information from the entire document
Ctrl-R, Ctrl-PSwaps the anchor and endpoint of the current selection
Ctrl-M, Ctrl-LToggles all previously marked hidden text sections between hidden and display states
Ctrl-K, Ctrl-KSets or removes a bookmark at the current line
Ctrl-M, Ctrl-MToggles the currently selected hidden text section or the section containing the cursor if there is no selection between the hidden and display states
Ctrl-K, Ctrl-HSets or removes a shortcut in the tasklist to the current line
Ctrl-R, Ctrl-REnables or disables word wrap in an editor
Ctrl-R, Ctrl-WShows or hides spaces and tab marks
Ctrl-DeleteDeletes the word to the right of the cursor
Ctrl-BackspaceDeletes the word to the left of the cursor
Ctrl-Shift-TTransposes 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.





Text selection

ShortcutDescription
Shift-Left ArrowMoves the cursor to the left one character, extending the selection
Shift-Alt-Left ArrowMoves the cursor to the left one character, extending the column selection
Shift-Right ArrowMoves the cursor to the right one character, extending the selection
Shift-Alt-Right ArrowMoves the cursor to the right one character, extending the column selection
Ctrl-Shift-EndMoves the cursor to the end of the document, extending the selection
Ctrl-Shift-HomeMoves the cursor to the start of the document, extending the selection
Ctrl-Shift-]Moves the cursor to the next brace, extending the selection
Shift-Down ArrowMoves the cursor down one line, extending the selection
Shift-Alt-Down ArrowMoves the cursor down one line, extending the column selection
Shift-EndMoves the cursor to the end of the current line, extending the selection
Shift-Alt-EndMoves the cursor to the end of the line, extending the column selection
Shift-HomeMoves the cursor to the start of the line, extending the selection
Shift-Alt-HomeMoves the cursor to the start of the line, extending the column selection
Shift-Up ArrowMoves the cursor up one line, extending the selection
Shift-Alt-Up ArrowMoves the cursor up one line, extending the column selection
Shift-Page DownExtends selection down one page
Shift-Page UpExtends selection up one page
Ctrl-ASelects everything in the current document
Ctrl-WSelects the word containing the cursor or the word to the right of the cursor
Ctrl-=Selects from the current location in the editor back to the previous location in the navigation history
Ctrl-Shift-Page DownMoves the cursor to the last line in view, extending the selection
Ctrl-Shift-Page UpMoves the cursor to the top of the current window, extending the selection
Ctrl-Shift-Alt-Right ArrowMoves the cursor to the right one word, extending the column selection
Ctrl-Shift-Left ArrowMoves the cursor one word to the left, extending the selection
Ctrl-Shift-Alt-Left ArrowMoves the cursor to the left one word, extending the column selection





Project related

ShortcutDescription
Ctrl-Shift-B Builds the solution
Ctrl-NDisplays 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 project
Ctrl-Shift-NDisplays the New Project dialog
Ctrl-ODisplays the Open File dialog
Ctrl-Shift-ODisplays the Open Project dialog
Shift-Alt-ADisplays the Add Existing Item dialog
Ctrl-Shift-ADisplays the Add New Item dialog
Ctrl-Alt-InsertAllows you to override base class methods in a derived class when an overridable method is highlighted in the Class View pane





Window manipulation

ShortcutDescription
Shift-Alt-EnterToggles full screen mode
Ctrl-+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 operation
Ctrl-F4Closes the current MDI child window
Shift-EscCloses the current tool window
Ctrl-F2Moves the cursor to the navigation bar at the top of a code view
Ctrl-Tab Cycles through the MDI child windows one window at a time
Ctrl-F6,Ctrl-Shift-TabMoves to the previous MDI child window
Alt-F6,Ctrl-Shift-F6Moves to the next tool window
Shift-Alt-F6Moves to the previously selected window
F6Moves to the next pane of a split pane view of a single document
Shift-F6Moves to the previous pane of a document in split pane view
Ctrl-PagedownMoves 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 view
Ctrl-PageUpMoves to the previous tab in the document or window





Control editor (designer)

ShortcutDescription
Ctrl-Down ArrowMoves the selected control down in increments of one on the design surface
Down ArrowMoves the selected control down to the next grid position on the design surface
Ctrl-Left ArrowMoves the control to the left in increments of one on the design surface
Left ArrowMoves the control to the left to the next grid position on the design surface
Ctrl-Right ArrowMoves the control to the right in increments of one on the design surface
Right ArrowMoves the control to the right into the next grid position on the design surface
Ctrl-Up ArrowMoves the control up in increments of one on the design surface
Up ArrowMoves the control up into the next grid position on the design surface
TabMoves to the next control in the tab order
Shift-TabMoves to the previous control in the tab order
Ctrl-Shift-Down ArrowIncreases the height of the control in increments of one on the design surface
Shift-Down ArrowIncreases the height of the control to the next grid position on the design surface
Ctrl-Shift-Left ArrowReduces the width of the control in increments of one on the design surface
Shift-Left ArrowReduces the width of the control to the next grid position on the design surface
Ctrl-Shift-Right ArrowIncreases the width of the control in increments of one on the design surface
Shift-Left ArrowIncreases the width of the control to the next grid position on the design surface
Ctrl-Shift-Up ArrowDecreases the height of the control in increments of one on the design surface
Shift-Up ArrowDecreases the height of the control to the next grid position on the design surface





ShortcutDescription
Ctrl-FDisplays the Find dialog
Ctrl-Shift-FDisplays the Find in Files dialog
F3Finds the next occurrence of the previous search text
Ctrl-F3Finds the next occurrence of the currently selected text or the word under the cursor if there is no selection
Shift-F3Finds the previous occurrence of the search text
Ctrl-Shift-F3Finds the previous occurrence of the currently selected text or the word under the cursor
Ctrl-DPlaces the cursor in the Find/Command line on the Standard toolbar
Alt-F3, HSelects or clears the Search Hidden Text option for the Find dialog
Ctrl-IStarts 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, CSelects or clears the Match Case option for Find and Replace operations
Alt-F3, RSelects or clears the Regular Expression option so that special characters can be used in Find and Replace operations
Ctrl-HDisplays the Replace dialog
Ctrl-Shift-HDisplays the Replace in Files dialog
Ctrl-Shift-IPerforms an incremental search in reverse direction
Alt-F3, SHalts the current Find in Files operation
Alt-F3, BSelects or clears the Search Up option for Find and Replace operations
Alt-F3, WSelects or clears the Match Whole Word option for Find and Replace operations
Alt-F3, PSelects or clears the Wildcard option for Find and Replace operations





Help

ShortcutDescription
Ctrl-Alt-F1Displays the Contents window for the documentation
Ctrl-F1Displays 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 cursor
F1Displays 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 cursor
Ctrl-Alt-F2Displays the Help Index window
Shift-Alt-F2Displays the Index Results window, which lists the topics that contain the keyword selected in the Index window
Alt-Down ArrowDisplays the next topic in the table of contents. Available only in the Help browser window
Alt-Up ArrowDisplays the previous topic in the table of contents. Available only in the Help browser window
Ctrl-Alt-F3Displays the Search window, which allows you to search for words or phrases in the documentation
Shift-Alt-F3Displays the Search Results window, which displays a list of topics that contain the string searched for from the Search window.
Shift-F1Displays a topic from Help that corresponds to the user interface item that has the focus





Debugging

ShortcutDescription
Ctrl-Alt-V, ADisplays the Auto window to view the values of variables currently in the scope of the current line of execution within the current procedure
Ctrl-Alt-BreakTemporarily stops execution of all processes in a debugging session. Available only in run mode
Ctrl-Alt-BDisplays the Breakpoints dialog, where you can add and modify breakpoints
Ctrl-Alt-CDisplays 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 mode
Ctrl-Shift-F9Clears all of the breakpoints in the project
Ctrl-Alt-DDisplays the Disassembly window
Ctrl-F9Enables or disables the breakpoint on the current line of code. The line must already have a breakpoint for this to work
Ctrl-Alt-EDisplays the Exceptions dialog
Ctrl-Alt-IDisplays the Immediate window, where you can evaluate expressions and execute individual commands
Ctrl-Alt-V, LDisplays the Locals window to view the variables and their values for the currently selected procedure in the stack frame
Ctrl-Alt-M, 1Displays 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 window
Ctrl-Alt-M, 2Displays the Memory 2 window
Ctrl-Alt-M, 3Displays the Memory 3 window
Ctrl-Alt-M, 4Displays the Memory 4 window
Ctrl-Alt-UDisplays 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 programs
Ctrl-BOpens the New Breakpoint dialog
Ctrl-Alt-QDisplays 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 expression
Ctrl-Alt-GDisplays the Registers window, which displays CPU register contents
Ctrl-Shift-F5Terminates the current debugging session, rebuilds if necessary, and then starts a new debugging session. Available in break and run modes
Ctrl-Alt-NDisplays the Running Documents window that displays the set of HTML documents that you are in the process of debugging. Available in break and run modes
Ctrl-F10Starts 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 running
Ctrl-Shift-F10Sets the execution point to the line of code you choose
Alt-NUM *Highlights the next statement to be executed
F5If 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-F5Runs 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 finishes
F11Executes code one statement at a time, tracing execution into function calls
Shift-F11Executes the remaining lines of a function in which the current execution point lies
F10Executes the next line of code but does not step into any function calls
Shift-F5Available in break and run modes, this terminates the debugging session
Ctrl-Alt-V, TDisplays the This window, which allows you to view the data members of the object associated with the current method
Ctrl-Alt-HDisplays the Threads window to view all of the threads for the current process
F9Sets or removes a breakpoint at the current line
Ctrl-F11Displays the disassembly information for the current source file. Available only in break mode
Ctrl-Alt-W, 1Displays the Watch 1 window to view the values of variables or watch expressions
Ctrl-Alt-W, 2Displays the Watch 2 window
Ctrl-Alt-W, 3Displays the Watch 3 window
Ctrl-Alt-W, 4Displays the Watch 4 window
Ctrl-Alt-PDisplays the Processes dialog, which allows you to attach or detach the debugger to one or more running processes





Object browser

ShortcutDescription
Alt-F12Displays the Find Symbol dialog
Ctrl-F12Displays the declaration of the selected symbol in the code
F12Displays the definition for the selected symbol in code
Ctrl-Alt-F12Displays the Find Symbol Results window
Ctrl-Alt-JDisplays 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 project
Alt-+Moves back to the previously selected object in the selection history of the object browser
Shift-Alt-+Moves forward to the next object in the selection history of the object browser





Tool window

ShortcutDescription
Ctrl-Shift-MToggles the Command window into or out of a mode allowing text within the window to be selected
Ctrl-Shift-CDisplays the Class View window
Ctrl-Alt-ADisplays the Command window, which allows you to type commands that manipulate the IDE
Ctrl-Alt-TDisplays the Document Outline window to view the flat or hierarchical outline of the current document
Ctrl-Alt-FDisplays the Favorites window, which lists shortcuts to web pages
Ctrl-Alt-ODisplays the Output window to view status messages at runtime
F4Displays the Properties window, which lists the design-time properties and events for the currently selected item
Shift-F4Displays the property pages for the item currently selected. (For example, use this to show a project's settings.)
Ctrl-Shift-EDisplays the Resource View window
Ctrl-Alt-SDisplays the Server Explorer window, which allows you to view and manipulate database servers, event logs, message queues, web services, and many other operating system services
Ctrl-Alt-RDisplays the web browser window, which allows you to view pages on the Internet
Ctrl-Alt-LDisplays the Solution Explorer, which lists the projects and files in the current solution
Ctrl-Alt-KDisplays the TaskList window, which displays tasks, comments, shortcuts, warnings, and error messages
Ctrl-Alt-XDisplays the Toolbox, which contains controls and other items that can be dragged into editor and designer windows





Html editor (Design View)

ShortcutDescription
Ctrl-BToggles the selected text between bold and normal
Ctrl-Shift-TDecreases the selected paragraph by one indent unit
Ctrl-TIndents the selected paragraph by one indent unit
Ctrl-IToggles the selected text between italic and normal
Ctrl-Shift-KPrevents an absolutely positioned element from being inadvertently moved. If the element is already locked, this unlocks it
Ctrl-GToggles the grid
Ctrl-Shift-GSpecifies 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 document
Ctrl-UToggles the selected text between underlined and normal
Ctrl-Shift-LDisplays the Bookmark dialog
Ctrl-JInserts <div></div> in the current HTML document
Ctrl-LWhen text is selected, displays the Hyperlink dialog
Ctrl-Shift-WDisplays the Insert Image dialog
Ctrl-Alt-Up ArrowAdds one row above the current row in the table
Ctrl-Alt-Down ArrowAdds one row below the current row in the table
Ctrl-Alt-Left ArrowAdds one column to the left of the current column in the table
Ctrl-Alt-Right ArrowAdds one column to the right of the current column in the table
Ctrl-Shift-QToggles display of marker icons for HTML elements that do not have a visual representation, such as comments, scripts, and anchors for absolutely positioned elements
Ctrl-Page DownSwitches from design view to HTML view and vice versa
Ctrl-QDisplays 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





Macro

ShortcutDescription
Alt-F8Displays the Macro Explorer window, which lists all available macros
Alt-F11Launches the macros IDE
Ctrl-Shift-RPlaces the environment in macro record mode or completes recording if already in record mode
Ctrl-Shift-PPlays back a recorded macro


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值