[英]DataTemplate not used when WPF control is opened within Windows Form Control
[英]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.