Home > other >  How can I set Opacity of WebView2 control in WPF
How can I set Opacity of WebView2 control in WPF

Time:01-04

How can I set Opacity of WebView2 control in WPF I need to change opacity of WebView2 from 0 to 1 by using Storyboard but when I am trying to set "Opacity =0" to WebView2 it doesn't get apply. So is there any way I can dynamically set its opacity?

CodePudding user response:

WebView2 is not a native wpf control,it does not support transparency settings.

you can use CEFSharp,it provides the same feature of WebView2, and supports transparency settings.

NuGet\Install-Package CefSharp.Wpf -Version 108.4.130

CodePudding user response:

It's simply impossible. WebView2 is HwndHost. it means they are native win32 windows placed exactly in location of specified in your WPF. So It's not a WPF element you can manipulate.

  • Related