In Visual Studio is there a command to collapse/expand all the sections of code in a file?
Visual-studio – Command to collapse all sections of code
visual-studio
Related Question
- C++ – Debugging with command-line parameters in Visual Studio
- Visual-studio – How to add an existing directory tree to a project in Visual Studio
- Visual-studio – Open two instances of a file in a single Visual Studio session
- Visual-studio – Difference between Build Solution, Rebuild Solution, and Clean Solution in Visual Studio
- Visual-studio – How to auto format code in Visual Studio
- Visual-studio – Error message “No exports were found that match the constraint contract name”
- Visual-studio – What are the differences between Visual Studio Code and Visual Studio
Best Solution
CTRL + M + O will collapse all.
CTRL + M + L will expand all. (in VS 2013 - Toggle All outlining)
CTRL + M + P will expand all and disable outlining.
CTRL + M + M will collapse/expand the current section.
CTRL + M + A will collapse all even in Html files.
These controls are also in the context menu under Outlining.
Right click in editor -> Outlining to find these controls. (After disabling outlining, use same steps to enable outlining.)
For outlining options: Go to Tools -> Options -> Text Editor -> C# -> Advanced -> Outlining for outlining options.