Expand & Collapse regions in all Visual Studio IDE’s

One of my favourite features of working with the Visual Studio Express Editions for ASP.NET and Windows Phone is regions in the code behind files.

#region my region

int string = “awesome”;

#endregion

And then you can hide the code within the region and expand the region when you need to review the code.

However these can build up and while you might like that since your region descriptions can be of sudo description in nature to explain what the regions code is doing however quick find does not look inside closed regions.

So to quickly expand and close all regions on a page there are keyboard shortcuts that I always forgot about lol

Double Tab CTRL+M to open/close the current region your cursor is closest to.

CTRL+M then CTRL+L to open/close all regions, methods, classes, namespaces.

CTRL+M then CTRL+O to close all regions & methods.

Resource: karpach.com

Advertisements

Published by

Alan Feekery

Developer, Gamer, Musician, Cyclist and big Motorsport fan... enjoys the odd cup of coffee :)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s