I have a project which has a main form and some other forms. When the app loads it needs to carry out some tasks and show the results in a modal form on top of the main form. T
Why dont you use the MainForm OnActivate
event like so?
procedure TMyMainForm.FormActivate(Sender: TObject);
begin
//Only execute this event once ...
OnActivate := nil;
//and then using the code David Heffernan offered ...
with TMyOtherForm.Create(nil) do begin
try
ShowModal;
finally
Free;
end;
end;
Setting the event to nil will ensure that this code is only run once, at startup.