.Web Browser Control – Specifying the IE Version
http://www.west-wind.com/weblog/posts/2011/May/21/Web-Browser-Control-Specifying-the-IE-Version

I use the Internet Explorer Web Browser Control in a lot of my
applications to display document type layout. HTML happens to be one of
the most common document formats and displaying data in this format –
even in desktop applications, is often way easier than using normal
desktop technologies.

One issue the Web Browser Control has that it’s perpetually stuck in
IE 7 (MSIE 7.0) rendering mode by default. Even though IE 8 and now 9 have
significantly upgraded the IE rendering engine to be more CSS and HTML
compliant by default the Web Browser control will have none of it. IE 9
in particular – with its much improved CSS support and basic HTML 5
support is a big improvement and even though the IE control uses some of
IE’s internal rendering technology it’s still stuck in the old IE 7
(MSIE 7.0) rendering by default.

This applies whether you’re using the Web Browser control in a WPF
application, a WinForms app, a FoxPro or VB classic application using
the ActiveX control. Behind the scenes all these UI platforms use the
COM interfaces and so you’re stuck by those same rules.

Feature Delegation via Registry Hacks

Fortunately starting with Internet Explore 8 and later there’s a
fix for this problem via a registry setting. You can specify a registry
key to specify which rendering mode and version of IE should be used by
that application. These are not global mind you – they have to be
enabled for each application individually.

There are two different sets of keys for 32 bit and 64 bit applications.

[(HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE)\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION]

32 bit:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION

Value Key: yourapplication.exe

64 bit:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION

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 the !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 the !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.

最新文章

  1. Nodejs-搭建Nodejs开发环境
  2. [转]Unity 脚本生命周期流程图
  3. 黄聪:MYSQL提交一批ID,查询数据库中不存在的ID并返回
  4. CI 自动提交表单
  5. html5游戏引擎-Pharse.js学习笔记(一)
  6. Ubuntu14.04 安装QQ国际版wine-qqintl
  7. iOS应用性能调优的4个建议和技巧
  8. AC_CONFIG_HEADER
  9. php中session_start()函数的作用
  10. 小甲鱼OD学习第8讲
  11. 【python标准库模块三】Os模块和Sys模块学习
  12. 快速搭建一个直播Demo
  13. springboot配置jsp
  14. python后端从数据库请求数据给到前端的具体实现
  15. caffe 错误
  16. 富文本编辑器 CKeditor 配置使用
  17. 一年内自学MIT的33门课? 疯狂学习有方法
  18. 你需要了解 Windows Phone 8.1 的11件事
  19. c++——派生类和基类转换(类型兼容性原则)
  20. 《Java程序设计》第六周学习总结 20165218 2017-2018-1

热门文章

  1. 网络流——SAP模板
  2. n++ ++n
  3. Sublime Text 3如何快速生成HTML5的头部信息和常用的快捷键
  4. 巨蟒python全栈开发django2:初识django
  5. an open source web server and reverse proxy
  6. hctf2016 fheap学习(FlappyPig队伍的解法)
  7. 任务03—简单程序测试及 GitHub Issues 的使用
  8. 什么是 C++ 11 原始字符串?
  9. Linux安装配置
  10. cache与buffer的区别