如何以编程方式关闭怪癖模式在IE8 WebBrowser控件? [英] How to programmatically turn off quirks mode in IE8 WebBrowser control?

查看:136
本文介绍了如何以编程方式关闭怪癖模式在IE8 WebBrowser控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用IE8作为一个C#应用程序WebBrowser控件。如何禁用怪癖模式,迫使IE浏览器进入标准符合性(只要它的实现)?

I want to use IE8 as a WebBrowser control in a C# application. How can I disable "quirks mode" and force IE into standards compliance (as far as it is implemented)?

推荐答案

我想你所面临的问题描述<一个href=\"http://blogs.msdn.com/ie/archive/2008/03/18/webbrowser-control-rendering-modes-in-ie8.aspx\">IEBlog: WebBrowser控件的渲染模式在IE8 :

I think the issue you're facing is described in IEBlog: WebBrowser Control Rendering Modes in IE8:

虽然网站管理员可以轻松地改变
  他们的网站在正确呈现
  IE的新版本,很多软件
  厂商所不具备的资源
  即刻推出的新版本
  它们与更新的应用程序
  内部网页。
  为了确保这些现有
  应用程序仍处于正常工作状态,
   IE8呈现页面内运行
  在WebBrowser控件实例
  IE7标准模式默认情况下。

While webmasters can easily alter their site to render properly in the new version of IE, many software vendors do not have the resources to instantly push out new versions of their applications with updated internal pages. In order to ensure that these existing applications remain in working order, IE8 renders pages running within instances of the WebBrowser control in IE7 Standards Mode by default.

下面我要指出,在页面上留言说,上面是不正确的,即 IE8呈现在默认情况下IE7严格模式或Quirks模式WebBrowser控件的实例中运行的网页,根据页面上的DOCTYPE。

Here I should note that the comments on the page say the above is incorrect, and that "IE8 renders pages running within instances of the WebBrowser control in IE7 Strict Mode OR Quirks mode by default, depending on the page's doctype."

的解决方案如下:

当一个可执行文件加载实例
  WebBrowser控件它扫描
  注册表,以检查是否
  可执行希望IE7标准或IE8
  标准模式。

When an executable loads an instance of the WebBrowser control it scans the registry to check whether the executable wants IE7 Standards or IE8 Standards mode.

...

要在IE8标准模式下插入运行
  下面的注册表值:

To run in IE8 Standards Mode insert the following registry value:

[HKEY_CURRENT_USER \\软件\\微软\\互联网
  资源管理器\\ MAIN \\ FeatureControl \\ FEATURE_NATIVE_DOCUMENT_MODE]

MyApplication.exe= DWORD:13880

在这两种情况下,
  MyApplication.exe应更换
  与可执行文件的名称
  将要运行的WebBrowser控件
  一个指定的模式。

In both of these instances, MyApplication.exe should be replaced with the name of the executable that will be running WebBrowser controls in a specified mode.

所以它听起来像纲领性的解决方案是写在注册表中的一个关键说你想为 web浏览器您的特定应用控制IE8标准模式。

So it sounds like the "programmatic" solution is to write a key in the registry saying you want IE8 Standards mode for WebBrowser controls in your specific application.

这篇关于如何以编程方式关闭怪癖模式在IE8 WebBrowser控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆