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

  1. alanfeekery posted this
blog comments powered by Disqus