Delphi Xe2 VCL style and webbrowser

2019-07-06 22:27发布

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

2条回答
神经病院院长
2楼-- · 2019-07-06 23:04

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

查看更多
姐就是有狂的资本
3楼-- · 2019-07-06 23:07

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

查看更多
登录 后发表回答