[DUG] Delphi internals - form events
Conor Boyd
lists at conor.org.uk
Wed Aug 10 14:54:34 NZST 2005
I prefer to do my initialisation in a constructor for the form, rather than
an OnCreate event or similar.
E.g.
TMyForm = class(Tform)
Public
constructor Create(Aowner:TComponent); override;
End;
Constructor TMyForm.Create(Aowner:TComponent);
Begin
inherited;
{Do stuff}
End;
You're guaranteed that everything will be correctly initialised after the
inherited call.
HTH,
Conor
-----Original Message-----
From: delphi-bounces at ns3.123.co.nz [mailto:delphi-bounces at ns3.123.co.nz] On
Behalf Of John Bird
Form create versus activate.
If I understand correctly, program initialisation best goes into the create
event. I have worked out that the onactivate event for a main form fires
every time any second form closes and focus returns to the main form. Is
there any limitation about what can be put in the create event, I am
wondering because before Delphi I did some FoxPro and there was some things
to do with eg visual properties of components that could not be put in the
Create event as they didn't really exist yet....such things as (I think)
button1.visible:=false. Does Delphi have this kind of limitation or
anything you cannot do when the form is created but before it is shown? Any
general hints of what to put in each event would be appreciated.
More information about the Delphi
mailing list