[Lazarus] Hint about CreateWnd

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


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

> On Saturday 01 March 2008 13:53, Paul Ishenin wrote:
> > zeljko 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 ?
> >
> > better to use
> >
> > if HandleAllocated then
> >   DoSomeOperationWith(Handle)
> 
> This is exact what I'm using, and got that bad HINT message.

Replace
  DoSomeOperationWith(Handle)
with
  DoSomeOperationThatNeedsAHandle;

For example any Canvas operation needs a handle.


> > Handle will be created when your control become visible - before
> > that you should not use Handle property.


Mattias



More information about the Lazarus mailing list