Visual Studio: Is there a way to collapse all items of Solution Explorer?

Viewed 80198

I know that I can use Arrow Keys to collapse items of solution explorer one by one, but I would like to know if there is a way to collapse all items with only one operation. I want to know it because, today I have a solution with 6 projects that have at least two hundred files and if I try to collapse them one-by-one I will have a hard time.

Tree View - Solution Explorer (Visual Studio)

13 Answers

In VS 2019 just click Collapse All

enter image description here

Using Visual Studio 2017 and above

use shortcut

  • Open Tools > Options or press Alt + T + O
  • Under Environment tab > Keyboard (Also, you can create a shortcut for Tools.CustomizeKeyboard to open it directly)

To Collapse All

  • Search for "SolutionExplorer.CollapseAll"
  • Add a new shortcut for example Ctrl+Left Arrow,Ctrl+Left Arrow

To Expand All

  • Search for "SolutionExplorer.Folder.CollapseAll"
  • Add a new shortcut for example Ctrl+Right Arrow,Ctrl+Right Arrow

    enter image description here

  • Assign > OK

Related