Click here to Skip to main content
Click here to Skip to main content

Box Editing with VS2010 - Editing multiple lines at once

, 27 Apr 2010
Rate this:
Please Sign up or sign in to vote.
Visual Studio 2010 provides a feature by which it is now possible to edit multiple lines at one go.For e.g. say you have a class which you have three member variables which are declared as private.public class MyClass{ private int myInt; private double myDouble; private...
Visual Studio 2010 provides a feature by which it is now possible to edit multiple lines at one go.
 
For e.g. say you have a class which you have three member variables which are declared as private.
 
public class MyClass
{
   private int myInt;
   private double myDouble;
   private string myString;
 
   ...
}
 
Now if you want to change the access of these member variables from private to protected, in VS2008 and before you need to select each private word and change it to protected.
 
In Visual Studio 2010, there is a better alternative to that.
 
Just press Alt key and perform a vertical selection and select all the three private words. (If you are using the keyboard only, then use the keys Shift + Alt + Arrow keys to select the words.)
 
Now just type protected once and you will notice that protected is being typed in all the three lines together. Saves a lot of time! Smile | :)
 
public class MyClass
{
   protected int myInt;
   protected double myDouble;
   protected string myString;
   ...
}
 
Alternatively, you can copy the protected word first and then perform a vertical selection (using Alt key) of all the three private words and paste once. It will paste in all three lines.
 
Check these links for further reference:
 
Link 1[^]
Link 2[^]

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Ratish Philip
Software Developer NA
India India
Ratish Philip is a software developer with 8 years of experience. He loves programming in C#, WPF & Silverlight.
 
He is currently exploring the depths of Windows 8 programming.
 
Creating enriched user experiences is what appeals to him the most.
 
Occasionally expresses his creativity through pencil sketching too!
 
Ratish's personal blog: wpfspark.wordpress.com

Comments and Discussions

 
GeneralNot new Pinmembermiies29-Apr-10 2:27 
GeneralRe: Not new PinmemberRatish Philip30-Apr-10 3:16 
GeneralRe: Not new Pinmembermiies30-Apr-10 9:36 
GeneralRe: Not new PinmemberRatish Philip30-Apr-10 16:37 
GeneralReminds me of PC-Write 3.0 Pinmembersupercat927-Apr-10 6:36 
GeneralRe: Reminds me of PC-Write 3.0 PinmemberRatish Philip27-Apr-10 15:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web04 | 2.8.140721.1 | Last Updated 27 Apr 2010
Article Copyright 2010 by Ratish Philip
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid