为WebBrowser指定IE内核版本(MSIE 7.0)
.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.
为WebBrowser指定IE内核版本(MSIE 7.0)的更多相关文章
- Webbrowser指定IE内核版本(更改注册表)
如果电脑上安装了IE8或者之后版本的IE浏览器,Webbrowser控件会使用IE7兼容模式来显示网页内容.解决方法是在注册表中为你的进程指定引用IE的版本号. 比如我的程序叫做a.exe 对于32位 ...
- linux内核自己添加模块(内核版本:3.0.101)
做内核驱动第一步都是学习如何添加模块,这是基础,有了这个基础,剩下就是写代码了. 由于2.4到2.6内核版本的更新,无论是系统调用还是模块添加机制都有了巨大的变化,本人也因此饱经挫折,最后在3.0.1 ...
- 调整Winfrom控件WebBrowser的默认浏览器内核版本
一.问题解析: 今天在调试程序的时候,需要使用C#的客户端远程登录一个Web页面,用到了WebBrowser控件.但是却发现了一件很神奇的事情:当前浏览器使用的内核,可以通过访问下面这个网站获取:ht ...
- 调整WebBrowser的默认浏览器内核版本
原文出自:https://my.oschina.net/Tsybius2014/blog/492107 注:这个是写.net控件,其实delphi是一样的.作者已经写的比较全面了,我只是做了一点修改 ...
- Winfrom 中完美设置webbrowser控件内核版本
前言 .NET 版本更新了一代又一代,winform中的webbrowser控件的IE内核版本却始终用的IE7,好多网站都对IE7已经不支持.webbrowser这个控件就显得有些鸡肋,经过查找大佬门 ...
- c# webbrowser控件内核版本强制修改
int BrowserVer, RegVal; // get the installed IE version using (WebBrowser Wb = new WebBrowser()) Bro ...
- Buildroot 指定内核版本
/******************************************************************************** * Buildroot 指定内核版本 ...
- 通过批处理操作注册表实现winform应用中Webbrowser以指定的IE版本加载网页
通过批处理操作注册表实现winform应用中Webbrowser以指定的IE版本加载网页 rem 强制WebBrowser控件使用指定IE版本显示应用的网页 IF EXIST %windir%\Sys ...
- winfrom设置webBrowser框架默认的IE内核版本
要实现设置webBrowser框架默认的IE内核版本的功能需要三个方法 1:修改注册表信息来兼容当前程序 /// <summary> /// 修改注册表信息来兼容当前程序 /// /// ...
随机推荐
- TensorFlow实战:Chapter-4(CNN-2-经典卷积神经网络(AlexNet、VGGNet))
转载自:http://blog.csdn.net/u011974639/article/details/76146822 项目:https://www.cs.toronto.edu/~frossard ...
- python资源网站
whl安装包资源网站:http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy
- PHP制作姓名、学号。爱好等窗口
if (radioButton1.Checked == true) textBox2.Text = 姓名: + textBox1.Text + 性别: + radi ...
- Java StuNote 1
1. JAVA语言历史 无心插柳柳成荫,有心栽花花不开. JAVA由SUN Microsystem公司研发. 2. JAVA语言特点 a) 跨平台.一次编译.到处执行. b) 速度慢.但非常稳定, 没 ...
- tomcat开启远程调试
tomcat开启远程调试模式: 需要在启动脚本中的 JAVA_OPTS='-server -Xms1024m -Xmx1024m -Xmn384m -Xss256k -XX:PermSize=128m ...
- java integer String之equals vs ==
Integer a = new Integer(123); Integer b = new Integer(123); System.out.println(a == b); System.out.p ...
- 协程 Gevent
# 协程应用:爬虫 from gevent import monkey;monkey.patch_all() import gevent import requests import time def ...
- git原理:引用规格
引用规格(refspec):就是在 .git/config 里面那个配置远程仓库的东西 [remote "origin"]url = https://github.com/test ...
- django-admin 登录之后显示页面,表是否显示
如果是超级用户可以全部看到(如图),如果是普通用户,只能看到user与group 虽然实现了其功能,不过有些地方没搞懂,所以有些地方出了写的不好 ```class PermissionsMixin(m ...
- outlook 设置分类收邮件
打开outlook,工具---->“规则和通知”.建相应的规则即可.