繁体   English   中英

设置AllowTransparency = True时,Windows窗体控件未出现在WPF窗口中

[英]Windows Form Control doesn't appear in WPF windows when set AllowTransparency=True

现在,我有一个任务将Windows窗体面板添加到WPF窗口。 我以默认模式运行,并且运行正常,但是当我更改为AllowTransparency = True时,所有Windows窗体控件都消失了。

下面是我的代码将面板添加到控制,下面这里

这是源代码:

 System.Windows.Forms.Panel myPanel = new System.Windows.Forms.Panel();
 myPanel.BackColor = System.Drawing.Color.AliceBlue;
 myPanel.Visible = true;
 myPanel.Width = 500;
 myPanel.Height = 500;

WindowsFormsHost myHost = new WindowsFormsHost();
myHost.Child = myPanel;
ui_aaa.Children.Clear();
ui_aaa.Children.Add(myHost);
ui_aaa.UpdateDefaultStyle();

我需要找到在AllowTransparency模式下显示面板的方法。 谢谢

由于在AllowTransparency模式下显示时WPF和Windows窗体之间存在差异,WPF中的每像素与WinForm中的24 bpp GDI,我们无法在WPF中的AllowTransperency模式下显示Windows窗体控件

暂无
暂无

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

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