Floating ToolWindow does not show on the correct monitor when control is hosted in MFC

Docking/MDI for WPF Forum

The latest build of this product (v25.1.1) was released 18 days ago, which was before this thread was created.
Posted 8 days ago by Daniel Constantin - ModuleWorks GmbH
Version: 24.1.5
Avatar

Hi!

I have an WPF control having a ribbon with multiple tool windows. This control is hosted inside a MFC control.

The problem is when I press float to make the ToolWindow float it will appear on another monitor.

Can I somehow set the owner wpf control/window ?

Kind regards,

Daniel

Comments (1)

Answer - Posted 8 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Daniel,

When you Float a tool window, it will try to restore itself to the last floating location it was at.  Or if this is the first time floating, it will set WindowStartupLocation.CenterOwner on the hosting WPF Window.  I think the problem here is that since you are in a MFC application, there probably isn't an owner WPF Window available, right?  Then Windows is choosing where to open it.

Since there is no owner in this scenario, if you are invoking a menu item to float the tool window, you could alter the menu item to call the ToolWindow.Float(Point, Size) method instead of having it use its default ToolWindow.FloatCommand behavior.  That way you'd have some control over where it goes.  The DockSite.MenuOpening event lets you customize any menu opened for docking windows before the menu is displayed.


Actipro Software Support

Add Comment

Please log in to a validated account to post comments.