We have tons of sub-folders in our main client project, and every time you access a file in a sub-folder Visual Studio expands the sub-folder, and given how many files we have in these sub-folders, the scroll bar quickly becomes a tiny dot.
Once their open, there’s no easy way to collapse them all except to go through by hand and manually collapse each one again.
The Visual Studio team gave me the following reply to my suggestion for a “Collapse All” feature:
Posted by Microsoft on 3/29/2010 at 2:10 PM
Thanks for your feedback. This is a good suggestion and one that we unfortunately cannot incorporate in VS2010. However, here is a macro that should help in the meanwhile:Sub UIHierarchy_CollapseTree() Dim Hierarchy As UIHierarchy 'Change Hierarchy to the following line to collapse the active window 'Hierarchy = DTE.ActiveWindow.Object Hierarchy = DTE.Windows.Item(Constants.vsWindowKindSolutionExplorer).Object CollapseHierarchyItems(Hierarchy.UIHierarchyItems) End Sub Sub CollapseHierarchyItems(ByVal HierarchyItems As UIHierarchyItems) Dim SubHierarchyItem As UIHierarchyItem For Each SubHierarchyItem In HierarchyItems CollapseHierarchyItems(SubHierarchyItem.UIHierarchyItems) SubHierarchyItem.UIHierarchyItems.Expanded = False Next End Sub