Kellen Stuart
Kellen Stuart

Reputation: 8893

Visual Studio - Keyboard Shortcut to close Solution Explorer

CtrlAltL Opens Solution Explorer in Visual Sutdio.

But I'm unable to close it with the same keyboard shortcut.

As I need to do this often (to get more real estate on the screen), how do you close the Solution Explorer with a keyboard shortcut?

Upvotes: 3

Views: 2170

Answers (2)

SolverShade
SolverShade

Reputation: 11

Right-clicking on the close icon provides an option to hide the solution explorer by default. This should allow you to use a keyboard shortcut to access the solution explorer and hide the explorer when you leave.

Here is a visual example

Upvotes: 1

Sergey Vlasov
Sergey Vlasov

Reputation: 27890

You can create the following command with Visual Commander (language: C#) and assign a shortcut to close Solution Explorer:

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();
    }
}

Upvotes: 2

Related Questions