WebBrowser references the IE version. You can change the version to IE or webbrowserie.
A Winform project is created. The project uses the WebBrowser control. In the past, I always thought that WebBrowser is the built-in IE of the system that is directly called, and that the Web browser is displayed as the web browser. This is not the case. My Winform program loads a Web project. This project is not very compatible with IE 8's browser layout. The local machine uses IE8 and the project is. net4.0. Check the Web Project in a local browser. However, the layout problem occurs when you call WebBrowser in Winform to browse the Web project page. So I began to question whether WebBrowser is in IE8 mode. Then I opened IETester and checked it from IE9 to IE5. I found that the most similar layout to WebBrowser is in IE7 mode. After searching some relevant information, the original WebBrowser used the IE compatibility mode for browsing (IE7 mode ).
How can we make WebBrowser reference IE 8. You can use the new key value in the registry.
Open HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Internet Explorer \ MAIN \ FeatureControl \ FEATURE_BROWSER_EMULATION
Add a DWORD Value. Enter the key value name in your program name, and then fill in 1f40 in the value data. That is, IE8
After entering the information. Open WebBrowser in the program directory and you will see that the IE8 mode has been referenced in WebBrowser. The idea here is not to open it in.
The following are the Registry addresses to be modified for 32-bit 64-bit systems and the values of IE versions.
32 bit:
HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Internet Explorer \ MAIN \ FeatureControl \ FEATURE_BROWSER_EMULATION
Value Key: yourapplication.exe
64 bit:
HKEY_LOCAL_MACHINE \ SOFTWARE \ Wow6432Node \ Microsoft \ Internet Explorer \ MAIN \ FeatureControl \ FEATURE_BROWSER_EMULATION
Value Key: yourapplication.exe
The value to set this key to is (taken from MSDN here) as decimal values:
9999 (0x270F)
Internet Explorer 9. Webpages are displayed in IE9 Standards mode, regardless of! DOCTYPE directive.
9000 (0x2328)
Internet Explorer 9. Webpages containing standards-based! DOCTYPE directives are displayed in IE9 mode.
8888 (0x22B8)
Webpages are displayed in IE8 Standards mode, regardless of! DOCTYPE directive.
8000 (0x1F40)
Webpages containing standards-based! DOCTYPE directives are displayed in IE8 mode.
7000 (0x1B58)
Webpages containing standards-based! DOCTYPE directives are displayed in IE7 Standards mode.