Author: Erwin Molendijk
How do I make a splash screen for my application?
Answer:
First make a new form, this will be your SpashSreen.
Set Name to "Splash".
Set BorderStyle to "bsNone".
Put an image or whatever on it.
Make sure it is not auto-created. (Shift-Ctrl-F11)
Now edit your main program body:
1 program MyApp;
2 {... }3 begin4 Application.Initialize;
5 6 { ---------- PUT THIS IN: ------------- }7 Splash := TSplash.Create(Application);
8 Splash.Show;
9 Splash.Refresh;
10 { ------------------------------------- }11 12 ..
13 Application.CreateForm(...);
14 Application.Run;
15 end;
Now edit the OnShow event of your main form:
16 procedure TMainForm.FormShow(Sender: TObject);
17 begin18 {...}19 { Free Splash screen }20 Splash.Free;
21 end;
You now have a splash screen!
Tip: If you place the Spash.Free in a OnTimer event, you can control how long the user sees your splash screen.