2

I believe this is a pretty straight forward question. In Visual Studio 2015, Ctr+M+O collapsed all sections. I learned this trick from here: Visual Studio - Command to collapse all sections of code? Unfortunately, his does not work in Visual Studio 2017.

Michael Drum
  • 1,151
  • 5
  • 14
  • 26
  • Possible duplicate of [Collapse all methods in Visual studio code](https://stackoverflow.com/questions/42660670/collapse-all-methods-in-visual-studio-code) – jonvw Oct 09 '18 at 17:46
  • @jonvw Completely different question. This is about ALL. People see the other Q (I know I did) "collapse all methods" and focus in the "collapse all" part. The "methods" is confusing -- who would want that, and wouldn't it be called "collapse ONLY methods"? But that oddly-phrased Q comes up first in searches. – Owen Reynolds Aug 08 '20 at 14:38

1 Answers1

9

Use Ctrl + M + A to collapse all, but first you need to enable it through Tools > Options > Text Editor > C# > Advanced > Outlining > Tick Collapse #regions when collapsing to definitions.

Anja
  • 109
  • 1
  • 4
  • It is Ctrl+M+O to Collapse all https://stackoverflow.com/questions/42660670/collapse-all-methods-in-visual-studio-code?rq=1 – Akshay Anand Jun 20 '19 at 18:56
  • 1
    @AkshayAnand Ctrl+M+A will collapse up to the namespace, so my answer is technically right. – Anja Jul 15 '19 at 10:32