That's pretty much what we have for our transparent panel. So our calling
code is:
procedure TDbsPanel.WMEraseBkgnd(var Message: TWMEraseBkgnd);
begin
if not (csDestroying in ComponentState) and FTransparent then begin
U_WindowsUtils.PaintBackground(Self, Message.DC, True);
Message.Result := 1;
end
else begin
inherited;
end;
end;
David.
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Trevor Jones
> Sent: Tuesday, 1 June 2004 4:16 PM
> To: [EMAIL PROTECTED]; NZ Borland Developers Group - Delphi List
> Subject: Re: [DUG] Floating Object
>
>
> Leigh,
> as I said, there's way too much code to post on a mailing list.
>
> However, the essentials are:
>
> type
> THack = class(TWinControl); // to give you access to the PaintControls
> method
>
> procedure PaintBackground(Control : TWinControl; DC : HDC)
> var
> P : TPoint;
> Save : integer;
> begin
> if assigned(Control) and assigned(Control.Parent) then
> begin
> Save := SaveDC(DC);
> try
> P := Control.ClientOrigin;
> ScreenToClient(Control.Parent.Handle,P);
> MoveWindowOrg(DC,-P.X,-P.Y);
> SendMessage(Control.Parent.Handle,WM_ERASEBKGND,DC,0);
> THack(Control.Parent).PaintControls(DC,nil);
> finally
> RestoreDC(DC,Save);
> end;
> end;
> end;
>
>
> You need to call this with the DC set to what you get in the WM_ERASEBKGND
> method, and the control set to the one that is going to provide your
> background.
>
> HTH
> Trevor
>
>
>
>
> ----- Original Message -----
> From: "Leigh Wanstead" <[EMAIL PROTECTED]>
> To: "Trevor Jones" <[EMAIL PROTECTED]>; "NZ Borland Developers
> Group -Delphi List" <[EMAIL PROTECTED]>
> Sent: Tuesday, June 01, 2004 3:42 PM
> Subject: RE: [DUG] Floating Object
>
>
> > Hi Trevor,
> >
> > How about you post your code on this list? I am interested to know too.
> >
> > Regards
> > Leigh
> >
>
>
> _______________________________________________
> Delphi mailing list
> [EMAIL PROTECTED]
> http://ns3.123.co.nz/mailman/listinfo/delphi
>
_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi