关闭Visual Studio中的所有工具窗口? [英] Close all tool windows in Visual Studio?
问题描述
我已经开始在VS2010中拉出我的工具窗口.我喜欢它的工作方式,将工具窗口放在一个监视器上,而我的代码放在另一个监视器上.
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.
我了解Shift-Esc可以关闭单个窗口,但是有没有办法一次关闭所有工具窗口?
I know about Shift-Esc to close an individual window, but is there a way to close ALL tool windows at once?
一个特定于VS2010的答案很好,但是任何可行的方法都可以解决.
A VS2010 specific answer is fine, but anything that would work would be swell.
谢谢!
推荐答案
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).
在Visual Studio 2010中创建一个宏(在工具"->宏"->宏IDE ..."下),并将此代码放在公共模块中:
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
然后转到工具"->选项"->环境"->键盘",在该对话框中的显示包含以下内容的命令"框下,搜索宏".您新创建的宏就在此处,为其分配了键盘快捷键,而鲍勃(Bob)是您的叔叔,您可以关闭所有工具窗口:)
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 :)
我个人使用了Ctrl-W,C表示umm,窗口,关闭",但是您可以使用任何想要的方法:)
I personally used the code Ctrl-W, C for, umm, "Window, Close" but you can use whatever you'd like :)
这篇关于关闭Visual Studio中的所有工具窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!