In Visual Studio 2005/2008, you can hide and show windows and panels using macros. See this answer. Unfortunately, at the moment I do not have access to previous versions of VS, and there are no macros in new versions.
I am not eager to install an unnecessary Studio version for me, however I installed the Visual Commander extension (available for versions 2010-2015; it cannot be installed in the Express version). Tested on VS2015 Community.
After it is installed and the Studio is restarted, the VCmd item will appear in the menu. Select the Extensions item, add a new extension, give it an appropriate name (HideToolboxAndPropertiesPanes), select the C # v4.0 language and enter the following code:
using EnvDTE; using EnvDTE80; using Microsoft.VisualStudio.Shell; public class E : VisualCommanderExt.IExtension { public void SetSite(DTE2 DTE, Package package) { dte = DTE; windowEvents = DTE.Events.WindowEvents; windowEvents.WindowActivated += OnWindowActivated; } public void Close() { windowEvents.WindowActivated -= OnWindowActivated; } private void OnWindowActivated(Window gotFocus, Window lostFocus) { if (gotFocus.Caption.EndsWith(" [Design]")) { dte.Windows.Item(Constants.vsWindowKindProperties).AutoHides = false; dte.Windows.Item(Constants.vsWindowKindToolbox).AutoHides = false; } else { dte.Windows.Item(Constants.vsWindowKindProperties).AutoHides = true; dte.Windows.Item(Constants.vsWindowKindToolbox).AutoHides = true; } } private DTE2 dte; private WindowEvents windowEvents; }
Click on the buttons Compile, Install. Done! Our macro extension is installed. Now the Properties and Toolbox windows are automatically shown when a document is active that contains the string [Design]
in the title and is hidden in all other cases.