Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 Explorer" Then             item.Close()         End If     Next End Sub 
like image 972
Karsten Avatar asked May 18 '11 08:05

Karsten


People also ask

How do I see all open tabs in Visual Studio?

Simple installation: download, doubleclick to install, restart VS IDE. Then open all the tabs you want they all will be displayed and No hidden.

How do I close all in Vscode?

How to Collapse All Source Code in VS Code? To fold all top-level and child elements of your code: Enter command >fold and hit enter.


2 Answers

Go to Window -> Close All Documents

The shortcut is ALT W+L

like image 145
Uri Abramson Avatar answered Oct 18 '22 07:10

Uri Abramson


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

like image 28
m__ Avatar answered Oct 18 '22 08:10

m__