Delphi Xe2 VCL样式和Web浏览器 [英] Delphi Xe2 VCL style and webbrowser

查看:130
本文介绍了Delphi Xe2 VCL样式和Web浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Win7 x64,Delphi Xe2 update2

Win7 x64, Delphi Xe2 update2

提示:

  1. 编译为x32的新项目在项目选项中应用了视觉(vcl)样式,默认情况下已选择一个
  2. 在表单上的button1和WebBrowser1
  3. 在该按钮中,我们编写WebBrowser1.Navigate('http://google.com');
  4. 我们开始,我们按下按钮-在浏览器中,我们看到一个网站google.com,所有ок

我们将其编译为x64,它会在ок中启动,通过按下按钮,我们会收到错误消息"zerro上的浮动分割".

We compile as x64, it is started ок, by button pressing we receive an error "float division on zerro".

问题:

  1. 完全是这样(错误)吗?并为此而奋斗吗? (在x64模式下)
  2. 如何将视觉样式应用于滚动WebBrowser1? (在x32模式下) :(本机组件无法蒙皮,但AlphaControls蒙皮系统-可以正常工作,并且webbrowser滚动行的皮肤可以正常显示
  1. At all so (error)? And as with it to struggle? (in x64 mode)
  2. How to apply visual style to strips of scrolling WebBrowser1? (in x32 mode) :( a native component could not skin, but AlphaControls Skin system - work ok, and webbrowser scrolling lines skinned normal

p.s. update3尚未放入

p.s. update3 yet did not put

p.s.s.英文不好:on

p.s.s. bad english: on

推荐答案

可以通过将TWebBrowser组件子类化并处理这些事件来完成

This can be done subclassing the TWebBrowser component and handling these events

OnDocumentComplete
OnNavigateComplete2
OnBeforeNavigate2
OnCommandStateChange
OnProgressChange

加上 WM_SIZE Windows消息.

plus the WM_SIZE windows message.

关键是使用 TScrollbar 组件和Twincontrol作为容器与原始的Web浏览器滚动条重叠.

The key is use the TScrollbar component and a Twincontrol as container to overlap the original webbrowser scrollbars.

我刚刚写了一篇文章,深入解释了如何实现该方法

I just wrote an article which explains in depth how this can be implemented Delphi Vcl Styles and TWebBrowser

这篇关于Delphi Xe2 VCL样式和Web浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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