I am posting this in response to those who ask about replacing the webbrowser (WB) control’s default browser. You cannot ask the WB control to use a different browser, it is hardwired to use the current version of Microsoft’s Internet Explorer that is installed on the target computer.
It may appear that the WB control is using an older version than is installed; this is not the case. Microsoft in their infinite wisdom made the decision to make IE 7 the default-rendering mode for all applications that use the WB control. This can be observed by visiting this website:
This can be overridden by adding the application name to the registry key:
Doing this can be a royal pain in the butt. Especially when developing a program as you would need to make one entry for “ApplicationName.exe” and one for “ApplicationName.vshost.exe” (for debugging under VS).
This code adds and deletes the registry entry on the fly for you. Just add it to your project. That is all that needs to be done. It automatically makes the registry changes for you.
Disclaimer: This code makes changes to the registry on Windows based systems. This is an inherently dangerous operation. The author assumes no responsibity for issues related to your use of this code. Use at your own risk.
Edited by Dani: No need to write out all the code twice