Box Selection in Visual Studio 2010

Every day I am discovering something new with Visual Studio 2010 and In this post I am again going to explain you new interesting feature of Visual Studio 2010. We all required to modify the code in bulk some time and there is a new features for Visual Studio 2010 which enables to made changes in multiple line at same time. Let’s take a simple example like following.

using System;

namespace Parallel
{
    class Program
    {
           private int a=10;
           private int b=10;
           private int c=10;

           static void Main(string[] args)
           {

           }    
    }
}

In above code I have three private variable a,b and c and now I want to make them protected. There is two way either I do manually one by one or I can do it with box selection and modify them together. It very easy to use this feature Press ALT+ SHIFT and draw box with help of mouse on the code which you need to modify like following.

SelectedBox 

Now I want to make it protected so I started writing protected and it will modify all the line at same time like following.

ChangedCode

And now my code is like following.

using System;

namespace Parallel
{
    class Program
    {
           protected int a=10;
           protected int b=10;
           protected int c=10;

           static void Main(string[] args)
           {

           }    
    }
}
That's it. Hope you like it… Stay tuned for more…Till then Happy programming.
Shout it
Published Friday, July 22, 2011 5:43 PM by Jalpesh P. Vadgama

Comments

# re: Box Selection in Visual Studio 2010

Friday, July 22, 2011 11:17 AM by writing jobs

Great article! Thanks a lot.

# Box Selection in Visual Studio 2010: http://weblogs.asp.net/jalpeshpvadgama/archive/2011/07/22/box-selection-in-visual-studio-2010.aspx

Friday, July 22, 2011 4:18 PM by Twitter Mirror

Box Selection in Visual Studio 2010: http://weblogs. asp.net /jalpeshpvadgama/archive/2011/07/22/box

# re: Box Selection in Visual Studio 2010

Wednesday, December 14, 2011 6:45 AM by Kevlyn

This is an aritcle that makes you think "never thought of that!"

# re: Box Selection in Visual Studio 2010

Thursday, December 15, 2011 9:59 PM by Latrice

What a joy to find someone else who tihnks this way.