WebBrowser Control IE8 Compatibility Mode On/Off Switch

巧了我就是萌 提交于 2019-11-30 21:23:43

Would this post on IEBlog about WebBrowser rendering modes and IE8 help? Seems like you have to set the rendering mode specific to your application using a key in the registry.

I know the registry entry answer has been posted, so I thought I'd offer an alternative.

Do you own the site and have permissions for the server it runs on? If so, you can set the X-UA-Compatible header to be sent for every page on the site/server. See http://msdn.microsoft.com/en-us/library/cc288325(VS.85).aspx#Servers for information plus links for Apache/IIS7.

You can force rendering mode for embedded WebBrowser inside your application using "Internet Feature Controls" in IE registry keys:

HKEY_LOCAL_MACHINE or HKEY_CURRENT_USER
   SOFTWARE
      Microsoft
         Internet Explorer
            Main
               FeatureControl
                  FEATURE_BROWSER_EMULATION
                     YouApp.exe = (DWORD) 00000000 (see value below)
  • Value 9999 (0x270F)
    Windows Internet Explorer 9. Webpages are displayed in IE9 Standards mode, regardless of the !DOCTYPE directive.

  • Value 9000 (0x2328)
    Internet Explorer 9. Webpages containing standards-based !DOCTYPE directives are displayed in IE9 mode.

  • Value 8888 (0x22B8)
    Webpages are displayed in IE8 Standards mode, regardless of the !DOCTYPE directive.

  • 8000 (0x1F40)
    Webpages containing standards-based !DOCTYPE directives are displayed in IE8 mode.

  • 7000 (0x1B58)
    Webpages containing standards-based !DOCTYPE directives are displayed in IE7 Standards mode.

+1 if you find value to always run WebBrowser at currently installed version.

Source: http://msdn.microsoft.com/en-us/library/ee330730%28VS.85%29.aspx#browser_emulation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!