WPF ChromiumWebBrowser 隐藏滚动条

WPF ChromiumWebBrowser 隐藏滚动条

public MainWindow()
{
    webBrowser.FrameLoadEnd += OnBrowserFrameLoadEnd;
}

private void OnBrowserFrameLoadEnd(object sender, FrameLoadEndEventArgs args)
{
    if (args.Frame.IsMain)
    {
        args
            .Browser
            .MainFrame
            .ExecuteJavaScriptAsync(
            "document.body.style.overflow = 'hidden'");
    }
}

  

posted @ 2021-10-19 10:07  microsoft-zhcn  阅读(491)  评论(0编辑  收藏  举报