Dein Problem kann man schön mit WMFormVisible lösen
Delphi-Quellcode:
const
WM_FORM_VISIBLE = WM_USER + 1;
private
FormInitialised: Boolean;
procedure WMFormVisible(var msg: TMessage); message WM_FORM_VISIBLE;
end;
implementation
procedure TForm1.FormCreate(Sender: TObject);
begin
FormInitialised := False;
end;
procedure TForm1.WMFormVisible(var msg: TMessage);
begin
if not FormInitialised then
begin
FormInitialised := True;
Code hier rein
end;
end;