IE9 模式下 WebBrowser 控件中不需要的滚动条
使用 WinForms WebBrowser
控件 在编辑模式下(如此处所述),将控件切换到“IE9 模式”。
我正在使用此帖子中所述的元标记
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
切换到编辑模式。
这是处于“IE9 模式”时的样子:
相反,在不使用它的情况下使用它时在元标记上方,它正确地看起来像这样:
这里,它看起来符合预期;水平滚动条根本不存在,垂直滚动条也不活动。
我尝试了所有我能想到的 DOCTYPE;结果似乎保持不变。
(如果重要的话:切换到编辑模式的内容来自我的应用程序的内置迷你网络服务器的本地 HTTP URL,即不是来自字符串或文件 URL)。
我的问题是:
有没有办法在“IE9编辑模式”下将WebBrowser
控件与IE9一起使用,并且仅在必要时仍然具有滚动条?
Using the WinForms WebBrowser
control in edit mode (as described here), I am experiencing unnecessary scrollbars when switching the control into "IE9 mode".
I'm using the meta tag
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
as described in this posting to switch into editing mode.
This is how it looks like when being in "IE9 mode":
In contrast, when using it without the above meta tag, it correctly looks like this:
Here, it looks as expected; the horizontal scrollbar is not present at all and the vertical scrollbar is not active.
I tried every DOCTYPE I can think of; the result seems to stay the same.
(In case it matters: The content that is being switched into edit mode comes from a local HTTP URL of the built-in mini webserver of my application, i.e. not from a string or from a file URL).
My question is:
Is there a way to use the WebBrowser
control with IE9 in "IE9 edit mode" and still have the scrollbars only when necessary?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Web 浏览器控件中的滚动条由文档滚动设置决定,您可以使用 overFlow 样式将其关闭。
以下代码适用于防止出现任何滚动条:
The scrollbars in the Web Browser control is determined by the document scroll settings and you can use the overFlow style to turn it off.
The following code works for me in preventing any scrollbars to appear: