How to select a block of code in Visual Studio

By | August 19, 2013

This is quite interesting and a handy tip. You can use it very often during your development  when you want to select a complete code block very quickly.   Keep you cursor either at the starting or at the ending braces  Just press Ctrl + Shift + ] . You will find the complete code block is  being selected.

Here is the simple steps

1.  Put the cursor  at the starting of the block

Selecting Code Block 

2. Press Ctrl + Shift + ]

Selecting Code Block

You will find the complete code block between the start and end braces has selected.

Note : If you are using VS 2013 Preview, you can use ALT Key and UP / Down Arrow to move the code block up and down.

  • Alt + Up Arrow Key  – Move the Code Block / Line Upwards
  • Alt + Down Arrow Key – Move the Code Block / Line Downwards

This is often required for code movement or refactoring code, as for example, selecting a block and moving it into a method quickly.