Close all tabs in Visual Studio
I've arranged Visual Studio 2010 such that output, error list, find results and many other windows appear in the same "region". I don't know if that's the correct term, they appear as tabs next to each other. Is there a way to close all these windows at the same time, preferable a keyboard shortcut?
Edit: About the possible duplicate here: Close all tool windows in Visual Studio?. That is a pretty close question, and I didn't see it before posting. There is a difference though, I only want to close all windows inside a particular "region" not the solution explorer or properties. However I guess it should be possible to modify the macro from the answer:
Public Sub CloseAllToolWindows()
Dim items As EnvDTE.Windows = DTE.Windows
Dim item As Window
For Each item In items
If item.Kind = "Tool" And item.Visible And Not item.IsFloating And _
item.Caption <> "Solution Explorer" And _
item.Caption <> "Properties" And _
item.Caption <> "To-do Explorer" And _
item.Caption <> "Macro Explo开发者_运维问答rer" Then
item.Close()
End If
Next
End Sub
Go to Window -> Close All Documents
The shortcut is ALT W+L
Right click on one of the tabs, select "Close all but this", then close the last one the normal way. Its not optimal but its far less work than closing each and everyone.
Edit: this only works for open files. Not error list, output or such. My bad...
Edit: In Visual Studio 2013 Preview you can now right click on any open document tab and select Close All Documents
These are the best keyboard shortcuts when you work with tabs:
Close All Documents Alt + W, L or Alt + -, L
Close Current Documents Ctrl + F4 or Alt + F, C or Alt + -, C
Close All But This Alt + -, A
Open Containing Folder Alt + -, O
Copy Full Path Alt + -, U
Pin Tab Alt + W, P or Alt + -, P
Float Tab Alt + W, F or Alt + -, F
Auto Hide All Tab Alt + W, F or Alt + -, F
any shortcuts that you need just comment it...
If you don't want to use KB shortcut, you can right click a tab and choose close all.
No. You don't need Visual Studio 2013 as other post. You go to this to re-define your hotkey:
Tools >> Options >> Keyboard
Type : Window.CloseAll
in Show Command Containing
. You will see a line : Windows.CloseAllDocuments
. Double click into it.
At textbox Press shortcut keys : type shortcut you want for this hotkey.
At drop down list on the left, choose Text Editor
. Press Assign.
Repeat above step, but at drop down list, you choose : Global
Press OK
Now, each time you press the shortcut you have defined, all tabs will be close.
Help this help you :)
Unselect Tools | Options | Environment | General | Close Button affects active tab only.
精彩评论