WPF content in ElementHost not visible using DockPanel Suite

634 views Asked by At

I have a WPF control in an ElementHost on a WinForms form. I've added the Form to a DockPanel Suite pane. The WPF content displays correctly when the Form is floating, or docked left/right/top/bottom, but when DockState is Document the WPF content disappears, leaving a blank docked Form.

I've experimented with creating empty test WPF controls, and this behaviour occurs whenever an ElementHost is used on a WinForm, and docked using DPS. Can anyone suggest where to look for a fix ? I've set the WPF rendering to Software only, but it doesn't help with this problem.

Many thanks.

WinForms App using .NET 4.0, VS2012 on Windows 7 on VMWare Fusion on MacBook Pro.

1

There are 1 answers

0
Jack Welch On BEST ANSWER

After much poking around, the problem turned out to be due to a ToolStripContainer that was on the same form as the DPS DockPanel. When the ElementHost form was docked as document, this was being rendered over the top of it. I replaced the ToolStripContainer with a separate ToolStrip and MenuStrip (following the DockSample), and all works fine.