FloatingToolWindowContainersHaveMaximizeButtons equivalent property for DocumentWindow?

Docking/MDI for WPF Forum

Posted 4 months ago by Brad Salmon
Version: 19.1.0684
Avatar

The DockSite has 2 properties: FloatingToolWindowContainersHaveMaximizeButtons and FloatingToolWindowContainersHaveMinimizeButtons; but I don't see any obvious properties for floating Document Windows.

How do I prevent minimize and maximize buttons showing on a floating DocumentWindow?

Comments (6)

Answer - Posted 4 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Brad,

You can do something like this override on DockSite... note this method is called for all WPF Windows that host document or tool windows:

protected override void InitializeFloatingWindow(Window window) {
	var chrome = WindowChrome.GetChrome(window);
	if (chrome != null) {
		chrome.HasMaximizeButton = false;
		chrome.HasMinimizeButton = false;
	}
}


Actipro Software Support

Posted 4 months ago by Brad Salmon
Avatar

Thanks, this worked like a champ....now for a follow-up question :)

In v2015 if I floated a window and then double-clicked on the title bar of the window it would re-dock. Now when I double-click it maximizes the window. When I remove the maximize button using your recommended approach, double-clicking on the title bar does nothing.

I have added a Hook to capture the WM_NCLBUTTONDBLCLK on the window, but haven't found the API(s) to call to re-dock the tab(s) contained in the container window.

[Modified 4 months ago]

Posted 4 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Brad,

Sorry but a floating tool window title bar is now treated as a Win32 title bars so that when performing actions like dragging, the host Window can participate in Aero snap and other features provided by the system.  Part of us supporting that means that double-clicks are treated by the Win32 system like toggling maximized state if allowed, via the WM_NCLBUTTONDBLCLK message whose default behavior you are capturing.

You can call the ToolWindowContainer.Dock() method to restore the container to the main DockSite when it's floating.


Actipro Software Support

Posted 4 months ago by Brad Salmon
Avatar

I have DocumentWindows, not ToolWindows. Will ToolWindowContainer.Dock still work? If so, how am to get the ToolWindowContainer instance?

When I have a floating window, I can right-click on the tab of the floated DocumentWindow and there is a context menu item called "Move to Main Document Group". What does that do? I simply want to mimic that behavior when the user double-clicks on the title bar.

Answer - Posted 4 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Brad,

Ahh yes, then you'd want to use the DockingWindow.MoveToMdi() method instead and pass it the DockSite.PrimaryDockHost as the target. 


Actipro Software Support

Posted 4 months ago by Brad Salmon
Avatar

Thanks, that works like a charm!

The latest build of this product (v2019.1 build 0685) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.