Vadim
Vadim

Reputation: 21704

Collapse projects in Solution Explorer

How can I collapse / expand all projects in Solution Explore using keyboard?

Upvotes: 37

Views: 21686

Answers (5)

Chad Dienhart
Chad Dienhart

Reputation: 5194

In Visual Studio 2013 it is finally just part of solution explorer... with a "Collapse All" icon. enter image description here

The right click option available with earlier versions of power tools in is not there but clicking the icon is easier anyway.

Upvotes: 90

EddyQ
EddyQ

Reputation: 231

The *, + and - on the numeric pad controls do this:

  • Open the solution explorer, select the folder to expand and press *.

  • To collapse, press -.

  • Then if you have collapsed some sub-folders, press + to return to your partially collapsed version.

Upvotes: 23

ScottCate
ScottCate

Reputation: 2415

Press CTRL+ALT+L to focus on Solution Explorer. If it's not on the screen, or it's collapsed, this will focus on it.

Then press your left arrow key as many times as it takes to get to the solution, and with another left, it'll collapse the whole tree.

I jsut tested VS2008, and you can also press HOME, to get to the top of the tree.

If what you want, is the solution open, and all the project files closed, then ....

once you're home in the tree view, press down,left for each open project and|or open solution folder (if you have those).

The power tools that @Jason mentioned, might have a different solution, but this is how you can navigate the Solution Tree without any add-ins.

Upvotes: 6

Jason
Jason

Reputation: 89082

Power Commands for VS2008 has a command to do this, plus lots of other neat tools

http://code.msdn.microsoft.com/PowerCommands

You could also write a macro to do it, and assign it to a key combination

http://weblogs.asp.net/israelio/archive/2007/09/06/visual-studio-collapse-selected-node.aspx

Upvotes: 11

Related Questions