This blog post will list of some of the shortcuts that can be used to collapse or expand the section of code in Microsoft Visual Studio 2012 , Visual Studio 2015 , Visual Studio 2017 and Visual Studio 2019.
How to Collapse Section of Code in Visual Studio using shortcut key?
- Ctrl + M + O – This shortcut key will collapse all the sections of the code in the current form.
- Ctrl + M + M – This shortcut key will expand/collapse the current section.
- Ctrl + M + L – This shortcut key will expand all the sections.
- Ctrl + M + P – This shortcut key will disable the outlining in the editor and expand all the sections.