Search code examples
wpfz-order

WindowsFormsHost ZOrder


It appears WindowsFormsHost control is set to display on top. Is there any way to change its z-order to allow other WPF controls on the same window to be visible on top of the WindowsFormsHost control?


Solution

  • Unfortunately no, because of the way the winformshost is composited into a WPF window it must appear on top.

    See the z-order paragraph from here.

    In a WPF user interface, you can change the z-order of elements to control overlapping behavior. A hosted Windows Forms control is drawn in a separate HWND, so it is always drawn on top of WPF elements.

    A hosted Windows Forms control is also drawn on top of any Adorner elements.