c# WPF transparency over Winform controls

前端 未结 4 721
醉梦人生
醉梦人生 2021-02-08 23:02

I have a WPF control that I would like to overlay onto a WinForms application. So I have dutifully created a Element Host that can show the following WPF object:



        
4条回答
  •  渐次进展
    2021-02-08 23:24

    I think you're running into an airspace issue. AFAIK, you can't mix WPF transparency and ElementHost transparency since the ElementHost owns the airspace.

    There's a short blurb in the link about creating non-rectangular hwnds to host WPF content, and that may get you farther.

    Perhaps you can consider migrating more of the WinForms app to WPF?

提交回复
热议问题