You might want your pop-up screen to appear as early as possible, so ideally this should be done during the initialization phase, then it should disappear only when MainForm is ready to capture.
This is what we do in our application, where we reuse the About dialog as a splash screen , then release it when MainForm steals focus.
In dpr, as high as possible in the uses section after the required VCL / RTL blocks:
f_adtDlgAbout in 'f_adtDlgAbout.pas' {frmDlgAbout},
Unit About (FYI, FormStyle
equals fsStayOnTop
and Position
equals poScreenCenter
):
unit f_adtDlgAbout; [...] type TfrmDlgAbout = class(TForm) [...] procedure TfrmDlgAbout.SplashFormDeactivate(Sender: TObject); begin Release; end; initialization // Use it as a Splash screen with TfrmDlgAbout.Create(nil) do begin AlphaBlend := True; AlphaBlendValue := 208; BorderStyle := bsNone; btnOK.Visible := False; OnDeactivate := SplashFormDeactivate; Show; Update; end; end.
source share