Close all tabs in Visual Studio

Visual Studio

Visual Studio Problem Overview


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: https://stackoverflow.com/questions/4388746/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 Explorer" Then
            item.Close()
        End If
    Next
End Sub

Visual Studio Solutions


Solution 1 - Visual Studio

Go to Window -> Close All Documents

The shortcut is ALT W+L

Solution 2 - Visual Studio

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

Solution 3 - Visual Studio

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...

Solution 4 - Visual Studio

If you don't want to use KB shortcut, you can right click a tab and choose close all.

Solution 5 - Visual Studio

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 :)

Solution 6 - Visual Studio

Unselect Tools | Options | Environment | General | Close Button affects active tab only.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionKarstenView Question on Stackoverflow
Solution 1 - Visual StudioUri AbramsonView Answer on Stackoverflow
Solution 2 - Visual Studiom__View Answer on Stackoverflow
Solution 3 - Visual StudioMohamad ShiralizadehView Answer on Stackoverflow
Solution 4 - Visual StudioChristian4423View Answer on Stackoverflow
Solution 5 - Visual StudiohqtView Answer on Stackoverflow
Solution 6 - Visual StudioRichardView Answer on Stackoverflow