Its not necessary that you should know everything about Visual Studio IDE. but if you know few basics shortcuts within your IDE you can save much of your time. If you are a power user, you will certainly enjoy using keyboard shortcuts to perform various operations more quickly.most of you are already familiar with some of them:
- F5 for Debug.Start,
- F10 for Debug.StepOver
- F4 for View.Properties
I have included some of my favorite ones below.
Basics:
| F7 |
Toggles between design and code views. |
| F9 |
Toggles breakpoint. |
| F12 |
Go to definition of a variable, object, or function. |
| Ctrl+Shift+7
Ctrl+Shift+8
|
Quickly navigate forward and backwards in the go to definition stack. |
| Shift+F12 |
Find all references of a function or a variable. |
| Ctrl+M, Ctrl+M |
Expand and collapse code outlining in the editor. |
| Ctrl+K, Ctrl+C
Ctrl+K, Ctrl+U
|
Comment and uncomment line(s) of code, respectively. |
| Shift+Alt+Enter |
Toggles between full screen mode and normal mode. |
| Ctrl+I |
Incremental Search.
|
Navigation:
- Goto Line: Ctrl+G Brings up Go To Line allowing you to automatically jump to a line position
- Toggle Bookmark: Ctrl+K, Ctrl+K Set a bookmark to allow you to easily jump back to that position later.
- Next Bookmark/Previous Bookmark: Ctrl+K, Ctrl+N (Next); Ctrl+K, Ctrl+P (Previous) Moves between your set bookmarks.
Debugging/Running/Compiling:
- Insert/Remove (Simple) Breakpoint: F9 Create a default breakpoint which always fires when debugging.
- Insert (Complex) Breakpoint: Ctrl+B Brings up breakpoint dialogue allowing for conditional breakpoints, etc.
- Start (with Debugging if in Debug build): F5 Run without Debugging: Ctrl+F5 If you are in a release build, both F5 and Ctrl+F5 behave the same.
- Iterate Through Build Errors: F8 If your build fails, you can press F8 to move between the various errors in the task list.
Writing Code:
- Comment and Uncomment Code: Ctrl+K,Ctrl+C (Comment), Ctrl+K, Ctrl+U (Uncomment) Works on current line or multiple selected lines.
- Intellisense Autocomplete: Alt+RArrow or Ctrl+Space Start typing a keyword, then press Alt + Right Arrow or Ctrl + Space and Intellisense will complete the word (if what you’ve typed is identifiable) or bring up Intellisense with the nearest match. You can also do this before typing and Intellisense will come up.
- Dynamic Help: F1 Get in center of a method, type, class, etc in editor, press F1. Help comes up on that topic if it exists.
- View Code-Behind: F7 View the code-behind file from the .ASPX or .ASCX file
- Switch between Design and HTML View: Ctrl + PgUp or Ctrl + PgDown Move between HTML and Design view on .ASPX and .ASCX files.
- Switch between Tabs: Ctrl+Tab (Back), Ctrl+Shift+Tab (Forward) Useful for moving between open files in Visual Studio. Keeps track of the order in which you last visited the tabs and cycles through that.
- Go To Definition: F12 Click, Select or have cursor on text you wish to go to the definition of.
- Last cursor position: Ctrl + - (Back), Ctrl+Shift+- (Forward) Useful for moving between files you have been editing. Especially useful if you have done a Go To Definition or if you are stepping though code in the debugger.
- Toggle Wordwrap:Ctrl + R, Ctrl + R While you should make it a practice to limit the width of your lines so they don’t require wrapping, sometime you do have lines that scroll off the Screen. This wraps them for you so you can see the entire text without scrolling.
- CTRL+ALT+L: View Solution Explorer.
- SHIFT+F12: Find all references of a function or variable.
- F7: Toggle between Designer and Source views.
- CTRL+D or CTRL+/: Find combo (see section on Find Combo below).
- CTRL+M, O: Collapse to Definitions. This is usually the first thing I do when opening up a new class.
- CTRL+K, CTRL+C: Comment block. CTRL+K, CTRL-U (uncomment selected block).
- CTRL+-: Go back to the previous location in the navigation history.
- ALT+B, B: Build Solution. Related shortcuts: ALT+B, U (build selected Project), ALT+B, R (rebuild Solution).
- CTRL+ALT+Down Arrow: Show dropdown of currently open files. Type the first few letters of the file you want to select.
- CTRL+K, CTRL+D: Format code.
- CTRL+L: Delete entire line.
- SHIFT+ALT+Enter: Toggle full screen mode. This is especially useful if you have a small monitor.
- CTRL+K, X: Insert "surrounds with" code snippet.
- CTRL+B, T: Toggle bookmark. Related: CTRL+B, N (next bookmark), CTRL+B, P (prev bookmark).
even i dont use all of them but we should.. Happy Coding
see also http://www.imiscommunity.com/visual_studio_2005_tips_and_tricks