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
- Ctrl+F5 to run the website without debugging. F5 only will run the website in debugging mode.
- Stop Debugging: Shift+F5
- Restart Debugging: Ctrl+Shift+F5
- Break All: Ctrl+Alt+Break
- 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.
- F9 to toggle a break point.
- 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.
- Ctrl+S to save the current document. Ctrl+Shift+S to save all the documents at once.
- Print a document directly from the visual studio? Press Ctrl+P. This will bring the print dialog.
- Ctrl+F to find a text. A find dialog will be displayed. Then you are left with a number of options.
- Ctrl+H or Ctrl+Shift+H for find and replace.
- Ctrl+G to go to the specific line number in the current document.
- Open the web browser right from within the visual studio? Press Ctrl+Alt+R.
- 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.
- Press F4 to view the properties window for a control from the design page.
- To view the server explorer: Ctrl+Alt+S
- To view the solution explorer: Ctrl+Alt+L
- To view the output window: Ctrl+Alt+O
- To view the toolbox: Ctrl+Alt+X
- Press Shift+Alt+Enter to view/undo full screen.
- Press Ctrl+O to open a document from the project folder.
- Ctrl+F11 to view disassembly: the machine level code!
Visual Studio Tips
- To view the start page, navigate View->Other Windows->Start Page
- 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.
- 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.
- 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.
- 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.
- 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!
15 comments:
I think "Ctrl-Shift-L" (Solution Explorer) should be "Ctrl-Alt-L" (or "Ctrl-W,S" which IMHO is easier to use sometimes).
Also, "Ctrl-S" (Server Explorer) should be "Ctrl-Alt-S".
Ctrl+i > incremental search... priceless for me
CTRL + BREAK stops the build process (when you start it by accident)
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!
Shift+Ctrl+V .. loop through the clip board items.. this one I use most
(ctrl + K) + (Ctrl + F) - Format ur codes.. Very very useful
(Ctrl+K)+(Ctrl+C) -- Commenting the code
(Ctrl+K)+(Ctrl+U) -- Uncommenting the code
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.
Very helpful short-cuts. Thank you James,Kiran and Anj!
Ctrl + K + D is also can use for Format ur codes the
Thank you Amit. Ctrl + K +D formats for the design code and code behind also.
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??
Thanks you share this excellent blog.Keep it up..
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!