This is a well-known problem with WPF/WinForms interop, often referred to as the "airspace" issue. WinForms controls added to a WPF window have severe limitations:
- HwndHost cannot be rotated, scaled, skewed, or otherwise affected by a Transform.
- HwndHost does not support the Opacity property (alpha blending). If content inside the HwndHost performs System.Drawing operations that include alpha information, that is itself not a violation, but the HwndHost as a whole only supports Opacity = 1.0 (100%).
- HwndHost will appear on top of other WPF elements in the same top-level window. However, a ToolTip or ContextMenu generated menu is a separate top-level window, and so will behave correctly with HwndHost.
- HwndHost does not respect the clipping region of its parent UIElement. This is potentially an issue if you attempt to put an HwndHost class inside a scrolling region or Canvas.
- While the mouse is over the HwndHost, your application does not receive WPF mouse events, and the value of the WPF property IsMouseOver will be false.
- While the HwndHost has keyboard focus, your application will not receive WPF keyboard events and the value of the WPF property IsKeyboardFocusWithin will be false.
- When focus is within the HwndHost and changes to another control inside the HwndHost, your application will not receive the WPF events GotFocus or LostFocus.
- Related stylus properties and events are analogous, and do not report information while the stylus is over HwndHost.
There were plans to fix this in .NET 4.5; unfortunately, the relevant properties were dropped in the final release:
Mitigating Airspace Issues In WPF Applications[
^]
There was a UserVoice suggestion to bring these beta features back, but that was declined:
Bring back the HwndHost.IsRedirected and CompositionMode[
^]
There are various workarounds which attempt to solve the problem (eg:
Over-coming the Interop Airspace Issue in WPF[
^]). However, there's no guarantee that they'll work as you need them to.
The best solution is probably to try to recreate the control in WPF.