WinForm webbrowser框架渲染 [英] WinForm webbrowser frame rendering

查看:195
本文介绍了WinForm webbrowser框架渲染的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好


我正在尝试通过windows webbrowser对象浏览页面http://bet.hkjc.com/racing/?lang = en 。


网址:  http://bet.hkjc.com/racing/?lang = zh


但似乎渲染与正常渲染不同浏览器(它通过在右侧放置小滚动条来剪切页面)。


我认为这可能是因为iframe及其加载。


< span style ="font-size:0.75em">无论如何,我可以渲染相同的内容,因为它看起来像
独立  单独的浏览器(即整页)? 


任何帮助将不胜感激。


谢谢,






解决方案

嗨Thomas268,


我想这个问题是因为网页浏览器停留在IE7中。


关于网络浏览器,有一个障碍:默认情况下,Web浏览器控件永久停留在
IE 7渲染模式中。尽管我们现在已经升级到IE 11和一个合理的HTML5兼容浏览器,但Web浏览器控件总是默认使用IE 7渲染引擎。这是因为ActiveX控件的原始版本使用了这个
模式,并且为了向后兼容性,Control继续这个过时且非常HTML5不友好的默认值。


这适用于你是否正在使用使用ActiveX控件的WPF应用程序,WinForms应用程序或FoxPro应用程序中的Web浏览器控件。在幕后,所有这些UI平台都使用相同的COM接口,因此你会遇到相同的规则。


好消息是有几种方法可以覆盖默认的渲染行为:


1,使用IE X-UA兼容 Meta标题


Hi

I'm trying to navigate page http://bet.hkjc.com/racing/?lang=en through windows webbrowser object.

Url: http://bet.hkjc.com/racing/?lang=en

But it seems like rendering doesnt render same as normal browser (It cuts the page by putting small scrollbar on right side).

I reckon it could be because of iframe and its loading.

Is there anyway I can render same as it looks in independent separate browser (that is full page)? 

Any help would be appreciated.

Thanks,

解决方案

Hi Thomas268,

I guess this issue is because the web Browser stuck in IE7.

About the web Browser, there's a snag: The Web Browser Control is - by default - perpetually stuck in IE 7 rendering mode. Even though we're now up to IE 11 and a reasonably HTML5 compatible browser, the Web Browser Control always uses the IE 7 rendering engine by default. This is because the original versions of the ActiveX control used this mode and for backwards compatibility the Control continues this outdated and very HTML5 unfriendly default.

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

The good news is there are a couple of ways to override the default rendering behavior:

1, Using the IE X-UA-Compatible Meta header


这篇关于WinForm webbrowser框架渲染的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆