Tuesday, June 9, 2009

22 Visual Studio Short Keys and 6 Short-cut Ways to Custom Jobs: A List of Tips and Tricks

Efficient programmers use short keys in IDE like Visual Studio. This saves time and in many cases makes the work run faster also. I also love short keys. They are smart! And there also go some tricks that help make your visual studio days a party! I have listed here some short cuts and some tips with the hope that this will be helpful to you all.

Visual Studio Short-cuts

  1. Ctrl+F5 to run the website without debugging. F5 only will run the website in debugging mode.
  2. Stop Debugging: Shift+F5
  3. Restart Debugging: Ctrl+Shift+F5
  4. Break All: Ctrl+Alt+Break
  5. F11 to debug line by line downwards from the toggle point. This works with F10 also. In fact you can see F10 assigned for this task. See Debug menu in the visual studio.
  6. F9 to toggle a break point.
  7. To delete all the break points at once: Ctrl+Shift+F9. If you only wish to disable the break points you can go down the Debug menu.
  8. Ctrl+S to save the current document. Ctrl+Shift+S to save all the documents at once.
  9. Print a document directly from the visual studio? Press Ctrl+P. This will bring the print dialog.
  10. Ctrl+F to find a text. A find dialog will be displayed. Then you are left with a number of options.
  11. Ctrl+H or Ctrl+Shift+H for find and replace.
  12. Ctrl+G to go to the specific line number in the current document.
  13. Open the web browser right from within the visual studio? Press Ctrl+Alt+R.
  14. Irritated switching back and forth the design view and code behind page of a file? Use F7 to navigate back and forth the files of a page.
  15. Press F4 to view the properties window for a control from the design page.
  16. To view the server explorer: Ctrl+Alt+S
  17. To view the solution explorer: Ctrl+Alt+L
  18. To view the output window: Ctrl+Alt+O
  19. To view the toolbox: Ctrl+Alt+X
  20. Press Shift+Alt+Enter to view/undo full screen.
  21. Press Ctrl+O to open a document from the project folder.
  22. Ctrl+F11 to view disassembly: the machine level code!

Visual Studio Tips

  1. To view the start page, navigate View->Other Windows->Start Page
  2. To initiate the start page to display feed from a website, Tools->Options->Startup. Choose show start page at start from the combo fox. Input the start page news channel rss feed. Click Ok.
  3. To display line numbers in the documents, Tools->Options->Text Editor. Now click the editor you need to display number in. Check Line Numbers at the right side of the window.
  4. Initiate the home page for the web browser [opened by pressing Ctrl+Alt+R]? Follow Tools->Options->Environment->Web Brower. Set the home page and optionally the search page from the right side of the window.
  5. Know the class name or method name but confused the right namespace? Right click the class name or method name and click Resolve; you will see the reference you need to add. Click the reference. It will be added for the page.
  6. Using find window and clicking Find button each time to go to next match? Leave the trend. Just press F3 to go to next match!!

Shortcuts are the small but useful ladders of programming. You can use them to go up and down, left and right or south and north. I would like to heartily welcome to share your tips and tricks that you have learned from your dedicated play around with the visual studio. All the tips and shortcuts I have listed above are tested and learned from visual studio 2005. They may or may not work in visual studio 2008 and later versions. You can specify the compatibility of your trick that you are posting as comment in this article. Thank you very much. Happy Programming!

kick it on DotNetKicks.com Shout it pimp it

15 comments:

Nathan Laan said...

I think "Ctrl-Shift-L" (Solution Explorer) should be "Ctrl-Alt-L" (or "Ctrl-W,S" which IMHO is easier to use sometimes).

Nathan Laan said...

Also, "Ctrl-S" (Server Explorer) should be "Ctrl-Alt-S".

Jaime said...

Ctrl+i > incremental search... priceless for me

Anonymous said...

CTRL + BREAK stops the build process (when you start it by accident)

Sangam Uprety said...

Thank you Nathan Laan for pointing the errors. I have corrected the shortcut for viewing Server Explorer(Ctrl+Alt+S) and Solution Explorer(Ctrl+Alt+L). Thank you Jaime and other anonymous reader for sharing the tips. Happy Programming!

Anz said...

Shift+Ctrl+V .. loop through the clip board items.. this one I use most

Anonymous said...

(ctrl + K) + (Ctrl + F) - Format ur codes.. Very very useful

Kiran Methuku said...

(Ctrl+K)+(Ctrl+C) -- Commenting the code
(Ctrl+K)+(Ctrl+U) -- Uncommenting the code

James Curran said...

You imply the F10 & F11 do the same thing. There is an important difference. F11 steps into method calls. F10 does the entire method call in one step, and stays in the calling method.

In general, Ctrl+(key) does something, and Shift+Ctrl+(key) does the same thing, bigger.

Hence Ctrl-S save the file; Shift+Ctrl+S saves all files.
Ctrl-F searches the current document; Shift+Ctrl+F searchs the entire solution.
Ctrl-H does a search'n'replace for the current document; Shift-Ctrl-H does it for all documents.

There are two exceptions to this.
- If {key} does somehting by itself (like an Fn key), then Shift reverse the action, and Ctrl is the "make it bigger" key.

- If {key} moves the cursor, then Ctrl is again the "make it bigger" meta-key, and Shift selects the text passed over.

Hence, F5 starts debugging, Ctrl-F5 starts without Debugging, and Shift-F5 End debugging.
F11 steps into a method call, and Shift-F11 steps out of it, back to the caller.

{home} move the cursor to the start of the line. Ctrl-Home moves the cursor to the start of the document, and Shift-Ctrl-Home select the text from the original position to the start of the document.

{Tab} with a block selected shifts it to the right, and Shift-Tab shifts it to the left. Ctrl-Tab steps through the open documents, and Shift-Ctrl-Tab steps through them in reverse order.

Sangam Uprety said...

Very helpful short-cuts. Thank you James,Kiran and Anj!

Amit said...

Ctrl + K + D is also can use for Format ur codes the

Sangam Uprety said...

Thank you Amit. Ctrl + K +D formats for the design code and code behind also.

Anonymous said...

Thanks for giving shortcut keys...It is very useful for time saving.
I have a question ,,,What is the shortcut key for to make a start up page??

Nick Adams said...

Thanks you share this excellent blog.Keep it up..

Nick Adams said...

Nice blog, i like it your blog information is so good and nice.I will bookmark your blog for my further updates...

Post a Comment

Hope you liked this post. You can leave your message or you can put your valuable suggestions on this post here. Thanks for the sharing and cooperation!

Popular Posts

Recent Articles