Following yesterday’s tip theme of code relocation, you can cut and paste a collapsed block of code, keeping all of the code inside intact.  Of course, this is exactly what you would expect, but I never thought about trying it. 

About to cut a selected collapsed block of code

With a block of code collapsed, as indicated to the right in the above illustration, select the block and cut or just cut the line via your favorite cut the line mechanism.  Now navigate to the desired location and paste.

Pasted code block

Note the code will be automatically expanded upon pasting.  You can quickly collapsed the text again by pressing Ctrl+M, Ctrl+M, but more on toggling outlining expansions in our next tip!

Technorati tags: VS2005Tip, VS2008Tip