In Visual Studio (2008) is there a command to collapse/expand all the sections of code in a file?
相关问题
- How to know full paths to DLL's from .csproj f
- Importing NuGet references through a local project
- the application was unable to start correctly 0xc0
- Visual Studio 2019 - error MSB8020: The build tool
- 'System.Threading.ThreadAbortException' in
相关文章
- How to show location of errors, references to memb
- How to add external file to application files ( cl
- How to track MongoDB requests from a console appli
- Visual Studio Hangs on Loading UI Library
- How to use Mercurial from Visual Studio 2010?
- Copy different file to output directory for releas
- Edit & Continue doesn't work
- “Csc.exe” exited with code -1073741819
The following key combinations are used to do things:
CTRL + M + M → Collapse / Expand current preset area (e.g. Method)
CTRL + M + H → Collapse / Hide (Expand) current selection
CTRL + M + O → Collapse all(Collapse declaration bodies)
CTRL + M + A → Collapse all
CTRL + M + X → Expand all
CTRL + M + L → Toggle all
There some options in the context menu under Outlining.
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 options are also in the context menu under Outlining.
Right click in editor -> Outlining to find all options. (After disabling outlining, use same steps to enable outlinging.)
In Visual Studio 2013:
CTL + M + A collapses all
CTL + M + L expands all
Ctrl+M expands region.
Ctrl+L collapses region.
In Visual Studio 2017, It seems that this behavior is turned off by default. It can be enabled under Tools > Options > Text Editors > C# > Advanced > Outlining > "Collapse #regions when collapsing to definitions"
If you mean shortcut then
CTRL + M + M: This one will collapse the region your cursor is at whether its a method, namespace or whatever for collapsing code blocks, regions and methods. The first will collapse only the block/method or region your cursor is at while the second will collapse the entire region you are at.
http://www.dev102.com/2008/05/06/11-more-visual-studio-shortcuts-you-should-know/