Rectangle 27 0

c Will the IE9 WebBrowser Control Support all of IE9's features, including SVG?


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION]
"contoso.exe"=dword:00002328
  • 7000 (0x1B58) - Webpages containing standards-based !DOCTYPE directives are displayed in IE7 Standards mode.
  • 8000 (0x1F40) - Webpages containing standards-based !DOCTYPE directives are displayed in IE8 mode.
  • 8888 (0x22B8) -Webpages are displayed in IE8 Standards mode, regardless of the !DOCTYPE directive.
  • 9000 (0x2328) - Internet Explorer 9. Webpages containing standards-based !DOCTYPE directives are displayed in IE9 mode.
  • 9999 (0x270F) - Internet Explorer 9. Webpages are displayed in IE9 Standards mode, regardless of the !DOCTYPE directive.

Sign up for our newsletter and get our top new questions delivered to your inbox (see an example).

Here is the complete set of codes:

I had to add the key to both current_user and local_machine before it would start working for me. But was successful after.

The IE9 "version" of the WebBrowser control, like the IE8 version, is actually several browsers in one. Unlike the IE8 version, you do have a little more control over the rendering mode inside the page by changing the doctype. Of course, to change the browser mode you have to set your registry like the earlier answer. Here is a reg file fragment for FEATURE_BROWSER_EMULATION:

With IE 9 installed, it doesn't seem possible to get a page to render in IE 8 mode. Setting the value to 7000 puts in IE 7 mode, and 8000/8888/9000/9999 put it in IE 9 mode. Whether this is some kind of bug or whether it's intentional I don't know though.

Note
Rectangle 27 0

c Will the IE9 WebBrowser Control Support all of IE9's features, including SVG?


Adding the registry key to the same path in HKCU instead of HKLM will also work - this is useful as writing to HKLM requires admin privileges where as HKCU does not.

And in there add 'myApplicationName.exe' with value '9000' to force the WebBrowser control to display pages in IE9 mode. Though there are other values you can use too too, note that these docs aren't entirely accurate as it does not seem possible to get a page to render in IE 8 mode whatever value you use.

Be careful, if you are running 32-bit applications (that call the 32-bit MSIE) on a 64-bit Windows, the registry entry should be added to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION instead.

I tried the meta tag but it would not work. I was getting an error message stating "HTML1115: X-UA-Compatible META tag (IE=9) ignored because document mode is already finalized.", which lead me to the webpage evolpin.wordpress.com/2011/02/25/. The solution was then to ensure that the meta tag was the first element inside the <head> block.

I was rendering html through xsl/xslt and the regedit didn't worked for some reason... The meta did the trick. Thanks!

If you want to take advantage of new IE9 features, you should add the meta tag <meta http-equiv="X-UA-Compatible" content="IE=9" > inside the <head> tag of your HTML page.

This meta tag must be added before any links to CSS, JavaScript files etc that are also in your <head> to work properly though (only other <meta> tags or the <title> tag can come before it).

WebBrowser control will use whatever version of IE you have installed, but for compatibility reasons it will render pages in IE7 Standards mode by default.

Note
Rectangle 27 0

c Will the IE9 WebBrowser Control Support all of IE9's features, including SVG?


I liked the (C#) code in the following which sets the registry settings for your app. Not sure if it will cut it after installation though if permissions are required. For me it solved an issue with WebSocket not being available inside a WebBrowser control in WPF.

Note
Rectangle 27 0

c Will the IE9 WebBrowser Control Support all of IE9's features, including SVG?


A note about 64bit Windows which seems to trip up a few folks. If your app is running under 64bit Windows, you likely have to set the DWORD under [HKLM\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION] instead.

Note
Rectangle 27 0

c Will the IE9 WebBrowser Control Support all of IE9's features, including SVG?


For each process (read also: vshost.exe, yourWinformApplication.exe.svchost, or the name of your application.exe) that will need to add a DWORD with the value provided, in my case I leave 9000 (in decimal) in application name and running smoothly and error-free script.

I totally agree with the solution provided, but I think a little clarification is important I think, might be necessary.

the most common mistake is to believe that it is necessary to add "contoso.exe" AS IS and think it all work!

Note