Hi
If its all to be on the same form,
the order of the events are
create,show,activate.
have a look at this atricle on delphi.
https://www.thoughtco.com/life-cycle-of-a-delphi-form-1058011I would not add too much to the Oncreate event, just the basics.
use the onshow and activate events; and havea variable that only allow it to run code once; as thiese events can be fired at other times.
maybe something like this.
global vars
formshowcodecomplete:boolean=false;
formactivatecodecomplete:boolean=false;
The onshow event you could add here something like.
begin
if formshowcodecomplete=false then
begin
formshowcodecomplete:=true;
// do code here to run only the minimum required to allow form to be dislayed.
mysplashpanel.visible:=true;
.. any important stuff;
end;
end;
in the onactivate event.
begin
if formactivatecodecomplete=false then
begin
formactivatecodecomplete:=true;
// do code here to run only once.
... do all the initializing stuff now, the stuff that takes time.
// depending on how much you could also update a visible progress throughout this routine.
mysplashpanel.visible:=false;
end;
end;