[Lazarus] Hint about CreateWnd

Mattias Gaertner nc-gaertnma at netcologne.de
Sat Mar 1 13:52:24 CET 2008


On Sat, 1 Mar 2008 13:14:05 +0100
zeljko <zeljko at holobit.net> wrote:

> I'm creating an customized control, and have such hint when creating
> form with such control:
> 
> [HINT] TWinControl.CreateWnd creating Handle during loading
> Form1:TForm1 csDesigning=False
> 
> Is this something bad , or I can live with it ?

It's bad.
It creates a lot of unneeded overhead.
As long as the control is csloading, csdestroying or not becomes visible
a Handle is not needed and should not be created.

Use 'if csLoading in ComponentState' to find out if it is still
loading. Loading is finished when 'procedure Loaded;' is called. You
can override that.


Mattias



More information about the Lazarus mailing list