[DUG] Delphi internals - form events

Conor Boyd lists at conor.org.uk
Wed Aug 10 16:09:12 NZST 2005


Yes, the components can be accessed in the OnCreate event.

I still prefer to put a lot initialisation stuff in the constructor.  To my
mind, a constructor unsurprisingly is about constructing the internals of an
object.  I prefer to leave event handlers for handling mainly GUI events.

Not sure about SetFocus, 'cos the form won't be visible at this stage.  I
think things like SetFocus would be better in the OnShow event that another
poster mentioned.

Keep asking the questions.

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

So if the Create event is after the DFM is read and all components exist it
looks like the components can be accessed...

is there anything that cannot be done....How about button1.setfocus  - will
this fail in the Create event?

(I will experiment, just trying to get to the grips on good practice of what
to put where, even Google doesn't shed much light)



More information about the Delphi mailing list