the wpf added winform controls
-
after put the control in wpf with winform, winform control in wpf control to cover What is the reason, should I do? picture
I'm sorry, but I'm not clear what you're asking. I've looked at the picture and I can see that you have airspace issues there - is this what you are asking about? An airspace issue is where you try to overlay Winforms and WPF rendering or a web page and WPF rendering. This is a known issue with WPF (and will be fixed in the next release of WPF) because you are trying to combine rendering stacks - the fix is not to use a Windows Forms control. Find a WPF one that does what you want and use that, or write one yourself - it's generally not that hard.
*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington
"Mind bleach! Send me mind bleach!" - Nagy Vilmos
CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier
-
after put the control in wpf with winform, winform control in wpf control to cover What is the reason, should I do? picture
There is a workaround which can be used to avoid this issue You need to wrap the WinformHost with UserControl of WPF. Follow these steps 1. Create a user control in the WPF (lookless control) 2. Create a style for this control 3. In the template of the style add WinformHost with x:name 4. Now override the OnApplyTemplate() of this control 5. Provide the .Child property of the Winformhost, added in the control template to the actual winform control that you want to display. Wrapping the winform control in the WPF control will avoid overlapping the WPF controls. This overlapping is due to difference in the mechanism for rendering control in WPF and Winforms. Winforms: uses GDI+ for rendering WPF: uses DirectX for rendering Hope this will help you to solve your problem Happy Coding :)