Friday, September 30, 2016

Expand or Collapse Regions in Visual Studio 2015

I frequently work with regions throughout my C# code, so I usually need to expand or collapse all regions in my code especially when I am refactoring code.

Therefore, I wanted to see if there was an easy way to accomplish this within Visual Studio.

Well, by default, Visual Studio uses the Edit-->Outlining menu to control the expanding and collapsing of regions:


However, there are some Quick Launch commands also available to you specifically while working with Regions!

These Quick Launch commands come to you courtesy of the Productivity Power Tools 2015: https://visualstudiogallery.msdn.microsoft.com/34ebc6a2-2777-421d-8914-e29c1dfa7f5d

Installing this extension adds Quick Launch items for "CollapseRegions" and "ExpandRegions":



In case you are not already aware, the Quick Launch menu appears in the top right hand corner of Visual Studio and allows you to search for various commands available to Visual Studio:



1 comment: