一、问题
WPF项目中需要在 Windows上做出透明效果,加上透明效果后,莫名其妙的windows上内嵌的WebBrowser就消失不见了。
二、解决方案
1、编写窗体xaml时,不要定义WindowStyle="None" AllowsTransparency="True"
2、在后端初始化时
public WIndex()
{
InitializeComponent();
//防止全屏遮盖windows工具栏
FullScreenManager.RepairWpfWindowFullScreenBehavior(this);
//解决WebBrowser 和window背景透明冲突问题
this.WindowStyle = System.Windows.WindowStyle.None;
this.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner;
this.ResizeMode = System.Windows.ResizeMode.NoResize;
this.ShowInTaskbar = false;
}
三、参考网址