Visual Studio - 关闭解决方案资源管理器的快捷键

3

CtrlAltL可以在Visual Studio中打开“解决方案资源管理器”。

但是我无法使用相同的键盘快捷方式关闭它。

由于我经常需要这样做(以获得更多屏幕空间),所以如何使用键盘快捷方式关闭“解决方案资源管理器”呢?


不是默认的快捷键你可以自己设置。这里有一个网站,列出了所有默认的快捷键,很容易查阅(https://www.dofactory.com/reference/visual-studio-shortcuts)。 - markorial
2个回答

2
你可以使用Visual Commander(语言:C#)创建以下命令,并分配一个快捷键来关闭解决方案资源管理器:
public class C : VisualCommanderExt.ICommand
{
    public void Run(EnvDTE80.DTE2 DTE, Microsoft.VisualStudio.Shell.Package package) 
    {
        var serviceProvider = package as System.IServiceProvider;
        var shell = (Microsoft.VisualStudio.Shell.Interop.IVsUIShell)serviceProvider.GetService(typeof(Microsoft.VisualStudio.Shell.Interop.SVsUIShell));
        var SolutionExplorer = new System.Guid(Microsoft.VisualStudio.Shell.Interop.ToolWindowGuids80.SolutionExplorer);
        Microsoft.VisualStudio.Shell.Interop.IVsWindowFrame frame;
        shell.FindToolWindow(0, ref SolutionExplorer, out frame);
        frame.Hide();
    }
}

1
可能可以工作,但是我最终转向了Rider,因为它内置了Shift + Esc命令。 - Kellen Stuart
上面的评论实际上应该被视为解决方案。它适用于Visual Studio 2019。 - Bruno

1
右键单击关闭图标会提供一个默认隐藏解决方案资源管理器的选项。这样可以让您使用键盘快捷键访问解决方案资源管理器,并在离开时隐藏资源管理器。

Here is a visual example


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接