Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF WebBrowser Browser Version

Does the WPF WebBrowser control depend on the version of IE that is installed on the user's machine, or does it use a separate library that is consistent across machines? I've read that it only renders in IE7 mode, but I want to make sure there wouldn't be any issues with a user who either doesn't have IE installed or is still on IE6 for some reason.

like image 972
mclark1129 Avatar asked May 01 '12 19:05

mclark1129


People also ask

What browser does WPF use?

WPF Browser applications (or XAML Browser applications, or XBAP) are a specific kind of application that are compiled into . xbap extensions and can be run in Internet Explorer.

Can WPF be used in Web applications?

For teams considering moving from development with C# and WPF to a more web-centric environment, you don't have to throw out years of experience and code. Instead, using some relatively new but battle-proven web frameworks, you can bring your existing . NET Framework skillset into the web app world.

How do I use WebBrowser control discuss?

The WebBrowser control has several properties, methods, and events that you can use to implement controls found in Internet Explorer. For example, you can use the Navigate method to implement an address bar, and the GoBack , GoForward , Stop , and Refresh methods to implement navigation buttons on a toolbar.


1 Answers

The MSDN remarks for WebBrowser indicate it rehosts the IE ActiveX control:

The WebBrowser control internally instantiates the native WebBrowser ActiveX control.

The WebBrowser ActiveX control is better known as Shdocvw.dll. This in turn wraps Mshtml.dll, and probably other DLL's given your environment. One caveat of rehosting this control is its setting for Browser Emulation:

For applications hosting the WebBrowser Control, the default value is 7000. To control the value of this feature by using the registry, add the name of your executable file to the following setting and set the value to match the desired setting.

0x7000 means IE7 compatibility mode. Therefore, if you would like your WPF application to render using some other mode you need to update the registry, as adapted from this example:

[HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION] 
"MyApplication.exe" = dword:2328
like image 144
user7116 Avatar answered Oct 04 '22 12:10

user7116