WebBrowser Control IE8 Compatibility Mode On/Off Switch

后端 未结 3 1848
栀梦
栀梦 2021-01-06 00:58

I am having a IE8 compatibility issue while using the WebBrowser control to navigate to a website. The strange thing is sometimes the website works, but more than likely it

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-06 01:45

    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

提交回复
热议问题