Author: Tomas Rutkauskas
How to fix the incorrect painting of an ActiveX control, which occurs when a web
page is scrolled
Answer:
In Delphi 4, when an ActiveForm is larger than the browser window the control is on
top of IE's scroll bars. In Delphi 5 they changed the code to fix this but didn't
get it quite right resulting in the painting problem when scrolling. You need to
edit the Delphi 5 AxCtrls unit as follows:
1 function TActiveXControl.SetObjectRects(const rcPosRect: TRect;
2 const rcClipRect: TRect): HResult;
3 var4 WinRect: TRect;
5 begin6 try7 IntersectRect(WinRect, rcPosRect, rcClipRect);
8 {BEGIN FIX}9 WinRect := Bounds(rcPosRect.left, rcPosRect.Top, WinRect.Right - WinRect.Left +
10 rcClipRect.Left - rcPosRect.Left, WinRect.Bottom - WinRect.Top +
11 rcClipRect.Top - rcPosRect.Top);
12 {END FIX}13 FWinControl.BoundsRect := WinRect;
14 Result := S_OK;
15 except16 Result := HandleException;
17 end;
18 end;