I've started to pull out my tool windows in VS2010. I like the way it works, I put tool windows on one monitor, and my code on the other.
However, my only gripe is occasionally I want to quickly close all the tool windows, and I'd love a way to close them all in one fell swoop.
I know about Shift-Esc to close an individual window, but is there a way to close ALL tool windows at once?
A VS2010 specific answer is fine, but anything that would work would be swell.
Thanks!
If you want to close all but one open file, simply right-click on the tab and select Close All But This. This will close all open documents (floating included) except the tab you've right-clicked on.
Right-click on the current document's tab and select Close Tabs to the Left to close all tabs to the left.
Ok, thanks to this blog I was able to cobble together a working solution. I'll recap it here in case that link ever dies, but all credit goes to The Boolean Frog (aka Pascal).
Create a macro in Visual Studio 2010 (Under Tools -> Macros -> Macros IDE...) and put this code inside a public module:
Public Sub CloseAllToolWindows()
Dim items As EnvDTE.Windows = DTE.Windows
Dim item As Window
For Each item In items
If item.Kind.Equals("Tool") And item.Visible Then
item.Close()
End If
Next
End Sub
Then head to Tools -> Options -> Enivornment -> Keyboard, inside the dialog there, under the Show commands containing: box, search for Macros. Your newly created macro is right there, assign it a keyboard shortcut, and Bob's your uncle you can close all Tool Windows :)
I personally used the code Ctrl-W, C for, umm, "Window, Close" but you can use whatever you'd like :)
You can assign a key to Window.AutoHideAll in vs2010 under Tools, Options Environment, Keyboard or use "Fullscreen" but these just hide the windows, not close them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With