The default version of the webbrowser control in a C# Windows Forms application is 7. I have changed to 9 by the article Browser Emulation, but how is it possible to use the latest version of the installed Internet Explorer in a webbrowser control?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
A cheap and easy workaround for it is that you can just put a value which is bigger than 11001 in the FEATURE_BROWSER_EMULATION key. Then it takes the latest IE that is available in the system.
I was able to implement Luca's solution, but I had to make a few changes for it to work. My goal was to use D3.js with a Web Browser control for a Windows Forms Application (targeting .NET 2.0). It is working for me now. I hope this can help someone else.
Also, I added a string (ie_emulation) to the project's settings with the value of 11999. This value seems to be working for IE11(11.0.15).
Next, I had to change the permission for my application to allow access to the registry. This can be done by adding a new item to your project (using VS2012). Under the General Items, select Application Manifest File. Change the level from asInvoker to requireAdministrator (as shown below).
If someone reading this is trying to use D3.js with a webbrowser control, you may have to modify the JSON data to be stored within a variable inside your HTML page because D3.json uses XmlHttpRequest (easier to use with a webserver). After those changes and the above, my windows forms are able to load local HTML files that call D3.
Visual Basic Version:
I saw Veer's answer. I think it's right, but it did not I work for me. Maybe I am using .NET 4 and am using 64x OS so kindly check this.
You may put in setup or check it in start-up of your application:
You may find messagebox.show, just for testing.
Keys are as the following:
Reference: MSDN: Internet Feature Controls
I saw applications like Skype use 10001. I do not know.
NOTE
The setup application will change the registry. You may need to add a line in the Manifest File to avoid errors due to permissions of change in registry:
UPDATE 1
This is a class will get the latest version of IE on windows and make changes as should be;
using of class as followed
you may face a problem for in comparability of windows 10, may due to your website itself you may need to add this meta tag
Enjoy :)
Rather than changing the RegKey, I was able to put a line in the header of my HTML:
See Web Browser Control & Specifying the IE Version.
According to what I read here (Controlling WebBrowser Control Compatibility:
The simplest thing is to put a very high decimal number ...