Tips and Tricks Visual Studio 2010

There are numbers of ways by which we can do efficient coding and track error easily. Visual studio provides various shortcut keystrokes and patterns that will help us to maintain well-organized and structured code. Find Tips and Tricks Visual Studio 2010.

Tips and Tricks Visual Studio 2010


We lost almost a week due to slow typing speed and debugging those same lines, thousand of times. finally got a great break through. Here are some tips and tricks to use Visual studio 2010 more efficiently.


Visual Studio is a very nice interface for developing code and designing web and windows forms. VSTS 2010 added lot of new IDE
This IDE feature includes easy and efficient debugging tools.


How to avoid accidentally copy/paste a blank line.
Most of the time by mistake we select blank line and try to copy, paste it. That will overwrite our clipboard contents and make them blank.
to avoid such mistake we have good trick in visual studio IDE.
Open Editor - Tools - options - select Text editor - All languages - General - Uncheck Apply cut or copy commands to blank lines where there is no selection



Incremental search
This is one of the advanced search concept. which allows you to search words on the fly. It will search words as you go on type.
To get the action just press CTRL+I and see the magic
status bar shows current searching.



Box selection and changes
Here is one of the nice gift of visual studio. you can select word in box pattern and change them at a time.
you need to Press ctrl and select word, you want to select.



Create your own snippet
Many times we copy paste the same line of code which is very generic. to do this process fast we can make our own code snippet
and use when ever we want.
following are steps to create own snippet

1. select code block of which you want to make snippet


2. Drag the code block to tool box and rename the snippet.


how easy ! your snippet is ready to use.


Some keyboard shortcuts
1. Go to definition of method or identifier - F12
2. Toggle Break point - F9
3. Indent document - CTRL+K+D
4. Make selection upper case - CTRL+SHIFT+U
5. Comment selection - CTRL+K+C
6. UnComment selection - CTRL+K+U
7. Immediate window - CTRL+ALT+I
8. Build solution - CTRL+SHIFT+B


Pinned up data
This is very good feature of visual studio. it allows you to pin up your code and showing variable values and expressions
that you want to watch during a debugging session. Its very handy
Just right click on the variable you wish to watch during runtime and select Pin To Source. now you can drag that pin and set a side for further use.
you can put comment for that pin and access it anywhere in code.



Multiple copy paste
This is great overcome on windows clipboard facility which replace our old data in clipboard with new one. here visual studio giving you facility to copy and paste with multiple words
it a cycle. to test this features do following steps
1. copy multiple code block one by one
2. Then paste them one after another using CTRL+SHIFT+V


Match Braces, comment, region, Quote
Many times we need to match ending brace in nested loops, if the code size more than hundred then it is critical task.
use simple key strokes to match braces, end region, comment and quotes.
hit CTRL+J to see magic.


Line Numbers
You editor should have line numbers. it is easy to track and found line number having errors.
make it turn ON by Tools - Options - Text Editor - All Languages - General - Line numbers


Thanking You
There are number of tips and tricks to use IDE efficiently. Many of them are out there in the open in the menus.
we will consider those one by one in next resources.
suggestion welcome.


Guest Author: pragash19 Jan 2012

for box selection we have to hold 'Alt' key instead 'ctrl' key.

Guest Author: 19 Jan 2012

Nice Man... Its very useful...

Guest Author: 19 Jan 2012

For Box Selection feature, we need to use 'Alt' key instead of 'Cntrl' key..

Author: Brainstorming Guy27 Jan 2012 Member Level: Gold   Points : 0

Thanks Prasad. Tip #1 is the most I like because I often do that.
Thanks again...

Author: mandarapuamala27 Feb 2012 Member Level: Silver   Points : 0

very useful.........
thank u..

Author: Pritom Nandy03 Feb 2013 Member Level: Gold   Points : 0

Thank you very much for sharing these tips. They were very helpful. #1, #2, #4 and #8 are very needful for me.

  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name: