Box Selection In Visual Studio

May 28th, 2008 Adrian Banks

I was editing a large SQL script inside Visual Studio today and needed to insert several spaces into multiple lines to make the script more readable.

Turning something like this:

some text on line a
some text on line b
some text on line c
some text on line d


some text      on line a
some text      on line b
some text      on line c
some text      on line d

I thought of doing it manually by hand, but as there were lots of lines to alter, I thought there must be a better way. I then remembered a feature of a word processor called ProText that I had many years ago on the Atari ST that had a feature called "Box Selection". This enabled you to select text across multiple lines without having to select the whole line (a bit like drawing a box with the mouse).

A quick search later and I found the instructions on how to do box selections in Visual Studio in an article on Sara Ford's blog.

Just hold down the Alt key whilst selecting text with the mouse and Visual Studio will switch from its normal "stream selection" mode into "box selection" mode. Once selected, you can indent the text using the tab key as normal and it will insert space to get the desired effect.

Entry Filed Under: Visual Studio

Subscribe to this feed Bookmark this post on Digg this post on Share this post

Leave a Comment


Required, hidden

Please enter the following word: magic word

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

Subscribe to the comments via RSS Feed


March 2017
« Oct    

Most Recent Posts

Related Posts

RSS Feeds Feeds


Visitor Map