This seems to be possible, at least in VS2013 (but will probably work with other versions supported by the VisualCommander extension). Here is the necessary macro, maybe someone will find it useful:
- Hide the title bar in Visual Studio 2013.
public class E : VisualCommanderExt.IExtension { public void SetSite(EnvDTE80.DTE2 DTE, Microsoft.VisualStudio.Shell.Package package) { events = DTE.Events; dteEvents = events.DTEEvents; dteEvents.OnStartupComplete += OnStartupComplete; } public void Close() { dteEvents.OnStartupComplete -= OnStartupComplete; } private void OnStartupComplete() { try { HideTitleBar(); } catch { } } private bool HideTitleBar() { System.Windows.FrameworkElement e = FindElement(System.Windows.Application.Current.MainWindow, "MainWindowTitleBar"); if (e != null) { e.Visibility = System.Windows.Visibility.Collapsed; return true; } return false; } private System.Windows.FrameworkElement FindElement(System.Windows.Media.Visual v, string name) { if (v == null) return null; for (int i = 0; i < System.Windows.Media.VisualTreeHelper.GetChildrenCount(v); ++i) { System.Windows.Media.Visual child = System.Windows.Media.VisualTreeHelper.GetChild(v, i) as System.Windows.Media.Visual; if (child != null) { System.Windows.FrameworkElement e = child as System.Windows.FrameworkElement; if (e != null && e.Name == name) return e; } System.Windows.FrameworkElement result = FindElement(child, name); if (result != null) return result; } return null; } private EnvDTE.Events events; private EnvDTE.DTEEvents dteEvents; }
Source: https://vlasovstudio.com/visual-commander/extensions.html
user1414213562
source share