

Setting the emulation version is very straightforward - add a value to the registry in the below key containing the name of your executable file and a value from the table above.Ĭopy Code HKEY_LOCAL_MACHINE (or HKEY_CURRENT_USER) SOFTWARE Microsoft Internet Explorer Main FeatureControl FEATURE_BROWSER_EMULATION yourapp.exe = (DWORD) version Default value for applications hosting the WebBrowser Control. Webpages containing standards-based !DOCTYPE directives are displayed in IE7 Standards mode. Webpages containing standards-based !DOCTYPE directives are displayed in IE8 mode. Webpages are displayed in IE8 Standards mode, regardless of the !DOCTYPE directive. Webpages containing standards-based !DOCTYPE directives are displayed in IE9 mode. Webpages are displayed in IE9 Standards mode, regardless of the !DOCTYPE directive. Webpages containing standards-based !DOCTYPE directives are displayed in IE10 Standards mode. Webpages are displayed in IE10 Standards mode, regardless of the !DOCTYPE directive.

Webpages containing standards-based !DOCTYPE directives are displayed in IE11 edge mode. Webpages are displayed in IE11 edge mode, regardless of the !DOCTYPE directive. The documentation doesn't mention if this is still the case regarding IE11 so I'm not sure about the behaviour in that regard. The exception to this dual behaviour is version 7 which is as is.Īccording to the documentation, the IE8 (8000) and IE9 (9000) modes will switch to IE10 (10000) mode if installed.

As you can see, it's possible to emulate all "recent" versions of Internet Explorer in one of two ways - either by forcing a standards mode, or allowing !DOCTYPE directives to control the mode. The table below ( source) lists the currently supported emulation versions at the time of writing. It's not as simple as setting some properties on a control as it involves setting some registry values and other caveats, but it is still a reasonable process. Rather fortunately however, Microsoft provides the ability to configure the emulation mode your application will use. Not so good as more and more sites use HTML5 and other goodies. One of the things that occasionally frustrates me is that by default, it is essentially an embedded version of Internet Explorer 7 - or enabling Compatibility Mode in a modern IE session. The WebBrowser control annoys me in myriad ways, but it does get the job done. I'm aware other embeddable browsers exist, but the idea of shipping additional multi-MB dependencies doesn't make sense unless an application makes heavy use of HTML interfaces. In most cases however, I need a more complex layout, JavaScript or I might want to display real pages from the internet - in which case I'm lumbered with the WebBrowser control. If it is just to display some simple layout with basic interactions, I might use a component such as HtmlRenderer.

Occasionally, I need to embed HTML in my applications.
