WebBrowser reference IE version issue, change the use of high version ie

Source: Internet
Author: User

Did a WinForm project. The WebBrowser control is used in the project. It used to be thought that WebBrowser is directly called the system comes with the ie,ie is to render what kind of page WebBrowser on what kind of page. Not really. My WinForm program loads a Web project. This project is not very good for IE8 browser layout compatibility. This machine is using the IE8, the project is. net4.0. There is no problem viewing the Web project in a native browser. However, the call to WinForm in the WebBrowser Browsing Web project page, there is a layout problem. So I began to question whether the WebBrowser is IE8 mode ah. So open the IETester, from IE9 to IE5 all over again, found that the most like the WebBrowser layout is presented in IE7 mode. After searching for some relevant information, the original WebBrowser is using IE's compatibility mode for browsing (IE7 mode).

How to let WebBrowser reference ie 8. Can be implemented by new key values in the registry

Open HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\main\featurecontrol\feature_browser_emulation

A new DWORD value is added to it. The key value name is written to your program name, and then the value data is populated with 1f40. That's IE8.

After completion. To the program directory open can see WebBrowser already reference IE8 mode, here is the idea is not in VS open.

Here are the registry addresses that the 32-bit 64-bit system needs to modify and the values for each version of IE
+ bit:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\main\featurecontrol\feature_browser_emulation
Value Key:yourapplication.exe
A bit:
Hkey_local_machine\software\wow6432node\microsoft\internet Explorer\main\featurecontrol\feature_browser_ EMULATION
Value Key:yourapplication.exe
The value to set of this key to be (taken from MSDN here) as decimal values:
9999 (0x270f)
Internet Explorer 9. Webpages is displayed in IE9 standards mode, regardless of the! DOCTYPE directive.
9000 (0x2328)
Internet Explorer 9. Webpages containing standards-based! DOCTYPE directives is displayed in IE9 mode.
8888 (0X22B8)
Webpages is displayed in IE8 standards mode, regardless of the! DOCTYPE directive.
8000 (0X1F40)
Webpages containing standards-based! DOCTYPE directives is displayed in IE8 mode.
7000 (0x1b58)
Webpages containing standards-based! DOCTYPE directives is displayed in IE7 standards mode.

WebBrowser reference IE version issue, change the use of high version ie

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.