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.
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.
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