作者:手机用户2502893987 | 来源:互联网 | 2023-09-12 21:14
效果:开始的时候会显示几秒,之后就不会再显示了
public MainWindow()
{
InitializeComponent();
webBrowser.FrameLoadEnd += OnBrowserFrameLoadEnd;
}
private void OnBrowserFrameLoadEnd(object sender, FrameLoadEndEventArgs args)
{
if (args.Frame.IsMain)
{
args
.Browser
.MainFrame
.ExecuteJavascriptAsync(
"document.body.style.overflow = 'hidden'");
}
}
参考资料:
https://***.com/questions/43742596/how-can-i-get-cefsharp-to-hide-both-the-vertical-and-horizontal-scrollbars-when