Multiple Line Editing in Visual Studio 2010

In one of my old tips I have discussed about how we can select a code block in Visual Studio by selecting “ALT” key. In this tips I will be discussion how that code block selection helps us to edit multiple line editing in VS 2010. Let’s say you have below code block,

image

Now, suddenly you found DateTime  list name does not matching with your coding standards, so you want to rename it to “datetimes”. Below is the two easy tricks for the same.

First change the list name to “datetimes” and press “Ctrl + . “ and Press Enter, this will automatic rename all the “listdatetimes” to “datetimes”

imageimage

More details can be found

Now, if you are in VS 2010, you can edit multiple line of code at same time. first change the “listdatetimes” to “datetimes” and then select all the old lastdatetimes variables using “ALT” key as shown in below and start typing the new variable name.

imageimage

Here is a nice video which talked about multiple line editing

Multiple Line Editing and Box Selection
Abhijit Jana

Abhijit runs the Daily .NET Tips. He started this site with a vision to have a single knowledge base of .NET tips and tricks and share post that can quickly help any developers . He is a Former Microsoft ASP.NET MVP, CodeProject MVP, Mentor, Speaker, Author, Technology Evangelist and presently working as a .NET Consultant. He blogs at http://abhijitjana.net , you can follow him @AbhijitJana . He is the author of book Kinect for Windows SDK Programming Guide.

One Comment to “Multiple Line Editing in Visual Studio 2010”

Comments are closed.