What are shortcuts for expand / collapse all regions in Visual Studio?

Regions in code break up  a code and make it easy to look thru.

CTRL+M CTRL+M (that's two key presses!) - collapse/open the current parent region

CTRL+M CTRL+L - Collapse/Open all regions in document recursively (meaning you might get only one line in the document - one big namespace region which is collapsed or you'll see the entire page code uncollapsed

CTRL+M CTRL+O - Collapse all regions not recursively

 


Friday, June 13, 2008 | Comments (10) | Add Comment

Comments

Gravatar

Re:What are shortcuts for expand / collapse all regions in Visual Studio?

This i use in shortcut in my software to user frendly

7/24/2008 10:46:12 AM | by mahendra
Gravatar

Re:What are shortcuts for expand / collapse all regions in Visual Studio?

Thanks

11/28/2008 9:53:33 PM | by Amit Prajapati
Gravatar

Re:What are shortcuts for expand / collapse all regions in Visual Studio?

thank you, very useful

10/22/2009 6:49:52 AM | by Thanker
Gravatar

Re:What are shortcuts for expand / collapse all regions in Visual Studio?

Thanks. I needed that.

11/6/2009 2:14:48 AM | by Emre
Gravatar

Re:What are shortcuts for expand / collapse all regions in Visual Studio?

Beautiful!

11/24/2009 8:40:54 AM | by Thankful
Gravatar

Re:What are shortcuts for expand / collapse all regions in Visual Studio?

CTRL + M and CTRL + L doesn't work like that for me in vs2008. It just opens the "namespace" region, not the nested regions.

12/4/2009 2:49:40 PM | by Chris May
Gravatar

Very strange. Just tried for myself. It works.

Gravatar

Re:What are shortcuts for expand / collapse all regions in Visual Studio?

Its gonna help all, very nice. post new ideas too, some about snippets and all

2/1/2010 11:50:12 PM | by Rino Reji
Gravatar

Re:What are shortcuts for expand / collapse all regions in Visual Studio?

thx

3/4/2010 9:53:08 AM | by TaTT_DoGG
Gravatar

Re:What are shortcuts for expand / collapse all regions in Visual Studio?

Cool. Thanks

4/7/2010 6:52:07 AM | by Oz
Gravatar

Re:What are shortcuts for expand / collapse all regions in Visual Studio?

Hi All,

Just press 'CTRL' + 'm' then while holding CTRL press 'o' this will collapse all subs etc. It will not collapse the Class itself. Also Look at Using Region "???" End Region, this is great for tiding code.

Kind Regards
John Galvin
www.sassytoll.com

4/14/2010 7:45:05 AM | by John Galvin

New Comment

Your Name:
Email (for internal use only):
Subject:
Comment:
 
Code above:

Categories

Recent Tweets

Valid XHTML 1.0 Transitional