Box Selection and Multi-Line Editing with VS 2010

Posted by Latest Microsoft Blogs on ASP.net Weblogs See other posts from ASP.net Weblogs or by Latest Microsoft Blogs
Published on Tue, 27 Apr 2010 00:53:21 GMT Indexed on 2010/04/27 6:43 UTC
Read the original article Hit count: 952

This is the twenty-second in a series of blog posts I’m doing on the VS 2010 and .NET 4 release. I’ve already covered some of the code editor improvements in the VS 2010 release.  In particular, I’ve blogged about the Code Intellisense Improvements Read More......(read more)

© ASP.net Weblogs or respective owner

Box Selection and Multi-Line Editing with VS 2010

Posted on Dot net Slackers See other posts from Dot net Slackers
Published on Tue, 27 Apr 2010 00:00:00 GMT Indexed on 2010/04/27 2:54 UTC
Read the original article Hit count: 952

Filed under:
This is the twenty-second in a series of blog posts Im doing on the VS 2010 and .NET 4 release. Ive already covered some of the code editor improvements in the VS 2010 release.  In particular, Ive blogged about the Code Intellisense Improvements, new Code Searching and Navigating Features, HTML, ASP.NET and JavaScript Snippet Support, and improved JavaScript Intellisense.  Todays blog post covers a small, but nice, editor improvement with VS 2010 the ability to use Box Selection...

Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.



Email this Article

© Dot net Slackers or respective owner

Box Selection and Multi-Line Editing with VS 2010

Posted by ScottGu on ASP.net Weblogs See other posts from ASP.net Weblogs or by ScottGu
Published on Tue, 27 Apr 2010 00:53:21 GMT Indexed on 2010/04/27 0:54 UTC
Read the original article Hit count: 952

This is the twenty-second in a series of blog posts I’m doing on the VS 2010 and .NET 4 release.

I’ve already covered some of the code editor improvements in the VS 2010 release.  In particular, I’ve blogged about the Code Intellisense Improvements, new Code Searching and Navigating Features, HTML, ASP.NET and JavaScript Snippet Support, and improved JavaScript Intellisense.  Today’s blog post covers a small, but nice, editor improvement with VS 2010 – the ability to use “Box Selection” when performing multi-line editing.  This can eliminate keystrokes and enables some slick editing scenarios.

[In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu]

Box Selection

Box selection is a feature that has been in Visual Studio for awhile (although not many people knew about it).  It allows you to select a rectangular region of text within the code editor by holding down the Alt key while selecting the text region with the mouse.  With VS 2008 you could then copy or delete the selected text.

VS 2010 now enables several more capabilities with box selection including:

  • Text Insertion: Typing with box selection now allows you to insert new text into every selected line
  • Paste/Replace: You can now paste the contents of one box selection into another and have the content flow correctly
  • Zero-Length Boxes: You can now make a vertical selection zero characters wide to create a multi-line insert point for new or copied text

These capabilities can be very useful in a variety of scenarios.  Some example scenarios: change access modifiers (private->public), adding comments to multiple lines, setting fields, or grouping multiple statements together.

Great 3 Minute Box-Selection Video Demo

Brittany Behrens from the Visual Studio Editor Team has an excellent 3 minute video that shows off a few cool VS 2010 multi-line code editing scenarios with box selection:

 

Watch it to learn a few ways you can use this new box selection capability to optimize your typing in VS 2010 even further:

Hope this helps,

Scott

P.S. You can learn more about the VS Editor by following the Visual Studio Team Blog or by following @VSEditor on Twitter.

© ASP.net Weblogs or respective owner

Related posts about Visual Studio

Related posts about .NET