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
History
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.
Introduction
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.Tip#1
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 Tip#2
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.Tip#3
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. Tip#4
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.Tip#6
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+BTip#7
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.Tip#8
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+VTip#9
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.Tip#10
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.
for box selection we have to hold 'Alt' key instead 'ctrl' key.