Moin,
wenn man sich TCustomForm.Create() anguckt, dann ruft er FOnCreate relativ spät auf:
Delphi-Quellcode:
constructor TCustomForm.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
{$IF DEFINED(CLR)}
GlobalNameSpace.AcquireWriterLock(MaxInt);
{$ELSE}
GlobalNameSpace.BeginWrite;
{$IFEND}
try
FCreatingMainForm := Application.FCreatingMainForm;
if FCreatingMainForm then
Application.FCreatingMainForm := False;
InitializeNewForm;
if (ClassType <> TForm) and not (csDesigning in ComponentState) then
begin
Include(FFormState, fsCreating);
try
if not InitInheritedComponent(Self, TForm) then
raise EResNotFound.CreateFmt(SResNotFound, [ClassName]);
finally
Exclude(FFormState, fsCreating);
end;
{$IF NOT DEFINED(CLR)}
if OldCreateOrder then
{$IFEND}
DoCreate;
end;
finally
{$IF DEFINED(CLR)}
GlobalNameSpace.ReleaseWriterLock;
{$ELSE}
GlobalNameSpace.EndWrite;
{$IFEND}
end;
end;
MfG
Fabian