我有一个网络浏览器,我正在加载一个 .html 文件。问题是虽然我已经将 ScrollViewer.VerticalScrollBarVisibility 设置为“隐藏”,但滚动条仍然可见。
我也尝试过这种方法,但它不起作用
<WebBrowser x:Name="personalizedWebBrowser" HorizontalAlignment="Left" VerticalAlignment="Top"
ScrollViewer.CanContentScroll="False"
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Hidden"
LoadCompleted="wb_LoadCompleted"/>
private void wb_LoadCompleted(object sender, System.Windows.Navigation.NavigationEventArgs e)
{
mshtml.IHTMLDocument2 dom = (mshtml.IHTMLDocument2)personalizedWebBrowser.Document;
dom.body.style.overflow = "hidden";
}
你能建议点别的吗?