Share via


The Best of Visual Studio 2010: Zero-Length Box Selection

Keyboard:  SHIFT + ALT + [ARROW]
Versions:  2010
Published:  1/14/2010
Code:  vstipEdit0009

 

Just a reminder to everyone that TODAY is the official launch of Visual Studio 2010.  To celebrate I'll be running this "Best of" series.  You can get more details about the launch here:

https://blogs.msdn.com/zainnab/archive/2010/04/12/visual-studio-2010-launches-today.aspx

 

Also, don't forget about the coolest swag giveaway ever!  I'll be giving away $100 ThinkGeek gift certificates whenever I feel like it.  You can get details here:

https://blogs.msdn.com/zainnab/archive/2010/04/02/announcing-the-tips-and-tricks-swag-fest-beginning-april-12th.aspx

 

I HAD to start with this tip to celebrate the Visual Studio 2010 Launch.  It is the coolest of all my VS2010 tips in my opinion.  Let's assume that you have a situation with some variables like the ones below and you want to make them all public:
clip_image002

 

The answer is a zero-length box selection.  Position your cursor at the top and to the left of the code (see previous picture for example).  Now press SHIFT + ALT + DOWN ARROW.  Note the line that is created:
clip_image004

 

Release the keys.  Now, just start typing:
clip_image006

 

Bask in the wonder and glory that is the zero-length box selection! :)