[Lazarus] Owner of a TCanvas

Howard Page-Clark hdpc at talktalk.net
Mon Jul 27 13:43:42 CEST 2015


On 27/07/2015 10:31, Xiangrong Fang wrote:
> Hi There,
>
> Can I somehow get the object which owns a Canvas? e.g.:
>
> function GetCanvasOwner(ACanvas: TCanvas): TObject;
> begin
>     Result := ACanvas.Owner;
> end;
> pb := TPaintBox(GetCanvasOwner(pb.Canvas);

A TCanvas does not have a built-in Owner property. It descends from 
TPersistent, but not from TComponent, the class that introduces Owner 
and ownership.


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus





More information about the Lazarus mailing list