Delphi Xe2 VCL style and webbrowser

試著忘記壹切 提交于 2019-12-10 19:54:08

问题


Win7 x64, Delphi Xe2 update2

Prompt:

  1. The new project, compile as x32, are applied visual (vcl) styles in the project options, by default one is chosen
  2. On the form the button1 and WebBrowser1
  3. In the button we write WebBrowser1.Navigate ('http://google.com');
  4. We start, we press the button - in a browser we see a site google.com, all ок

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

Questions:

  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 yet did not put

p.s.s. bad english: on


回答1:


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

OnDocumentComplete
OnNavigateComplete2
OnBeforeNavigate2
OnCommandStateChange
OnProgressChange

plus the WM_SIZE windows message.

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




回答2:


VCL styles cannot be applied to TWebBrowser AFAIK. Its UI is controlled by Internet Explorer, not the VCL.



来源:https://stackoverflow.com/questions/8284003/delphi-xe2-vcl-style-and-webbrowser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!