【问题标题】:Visual Studio - Keyboard Shortcut to close Solution ExplorerVisual Studio - 关闭解决方案资源管理器的键盘快捷键
【发布时间】:2019-06-13 05:49:28
【问题描述】:

CtrlAltL 在 Visual Sutdio 中打开解决方案资源管理器。

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

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

【问题讨论】:

标签: visual-studio visual-studio-2017 keyboard-shortcuts solution-explorer


【解决方案1】:

您可以使用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();
    }
}

【讨论】:

  • 可能有效,但我最终转向了内置 Shift + Esc 命令的 Rider
  • 上述评论实际上应该被认为是解决方案。它适用于 Visual Studio 2019。
猜你喜欢
  • 1970-01-01
  • 2011-05-07
  • 2011-09-08
  • 2012-09-16
  • 1970-01-01
  • 2012-11-24
  • 2010-09-11
  • 1970-01-01
  • 2013-02-02
相关资源
最近更新 更多