简体   繁体   English

如何在WPF托管时更改winforms面板的背景颜色?

[英]How to change the back ground color of winforms panel when it hosted in WPF?

I want host a winform Panel control in WPF by using WindowsFormsHost,after that,I found that I can't change the backcolor of hosted panel,or it's not working when you set BackColor="SomeColor".Any one has an idear? 我希望通过使用WindowsFormsHost在WPF中托管一个winform面板控件,之后,我发现我无法更改托管面板的背景色,或者当你设置BackColor =“SomeColor”时它无法正常工作。任何一个人都有一个想法?

    <WindowsFormsHost Grid.Row="1">
          <WinForms:Panel x:Name="VideoPanel" BackColor="Black" Dock="Fill"/>
    </WindowsFormsHost>

我找到了一个解决方案,设置窗口AllowTransparency =“False”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM