Visual Studio: Box Selection
Posted
Sun, Apr 4 2010 19:52
by
Deborah Kurata
I have been using Visual Studio for a long time, so I am always excited when I find out something about Visual Studio that I did not know. I'm not sure when it appeared (could it have been in Visual Studio 2002?), but I found it today: Box Selection.
Simply hold down the Alt key to select a rectangular box of text in the text editor instead of selecting lines.
Say, for example you have these two lines of code:
In C#:
You want to copy the comments to paste elsewhere. Just hold down the Alt key and select the text shown in green.
In VB:
You want to copy the comments to paste elsewhere. Just hold down the Alt key and select the text shown in green.
The text shown in yellow in both examples is your "box selection". You can then copy or paste it or even delete it.
Use this technique any time you want to copy, delete, or replace a block of text.
Enjoy!