WindowsFormsHost Problem, already dispaly on top, how to fix

Docking/MDI for WPF Forum

Posted 10 years ago by Myron Meng
Version: 9.1.0507
Avatar
<docking:DockSite x:Name="dockSite" AutoHidePerContainer="False" >
<docking:Workspace >
<docking:StandardMdiHost x:Name="standardMdiHost" >
<docking:DocumentWindow Title="1111ss1" Width="300" Height="200">
<WindowsFormsHost Name="windowsFormsHost1" HorizontalAlignment="Left" Width="162" Height="120" >
<WindowsFormsHost.Child >
<winform:PictureBox x:Name="pictureBox2" BackColor="DarkRed" Width="100" Height="50" />
</WindowsFormsHost.Child>
</WindowsFormsHost>
</docking:DocumentWindow>
<docking:DocumentWindow Title="222ss22" Width="320" Height="200" >
<Button>Test</Button>
</docking:DocumentWindow>
</docking:StandardMdiHost>
</docking:Workspace>
</docking:DockSite>

Comments (5)

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Myron,

Unfortunately due to how Microsoft implemented interop between WinForms and WPF, there is no way to clip WinForms content since it will always be above any WPF content in the same Window. Thus standard MDI will not work if you host any interop content.

You can however use tabbed MDI successfully by setting DockSite.UseHostedAutoHidePopups = false.


Actipro Software Support

Posted 9 years ago by David Mullin
Avatar
Completely unrelated to any ActiPro product, we are experiencing the same sort of issue (we've got a WinForms control below a ComboBox, and when the ComboBox is popped open, the dropdown ends up behind the WinForms control). At the risk of asking you to reveal trade secrets, could you shed some light on what magic you do when UseHostedAutoHidePopups = false?
Posted 9 years ago by Myron Meng
Avatar
The issue cannot be fixed and not working on this component anymore.
Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi David,

The rule of thumb is that any other Window or Popup should show on top of interop content. So since ComboBox shows a Popup, I would expect it to show on top of the interop. If that isn't working, perhaps it has to do with the Popup being defined in the ComboBox's template as opposed to externally? I'm not sure if that makes a difference or not though. We use Popups in Docking when that option you mentioned is on.


Actipro Software Support

Posted 9 years ago by David Mullin
Avatar
Yes, you are probably right about why the ComboBox doesn't display as desired. I was just hoping that you had some magic that you were doing when UseHostedAutoHidePopups = false that I could use for my project. Apparently not :-).
The latest build of this product (v2019.1 build 0681) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.