Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

How To

Make a SplashScreen by BobbaFet
Posted: 28 Nov 05

What is a splashscreen?

A splashscreen is an image shown to the user while the rest
of the program loads. This tells us two things:
1. The splashscreen is NEVER the mainform of the project.
2. It will need to be closed (or at least hidden) at some point.

Making the splashscreen itself is very simple:
------ METHOD 1:
- First go to "Project | Options":
Here you set the SplashScreen form to auto-create and the
mainform of the project to available.
- Next take a TImage and drop it on the form that you wish
to use as the splashscreen. Drop on that same form a TTimer.
Set the timer to the amount you want. Next you'll
have to code what happens when the timer runs out, namely:
Create the mainform. Something like:
Application.CreateForm(TForm1,Form1); should get the
desired results.

The final step is to have the mainform dispose of the
splashscreen. So you'll have to do something called form
linking to let the mainform access the splashscreen:

First make the mainform unit the unit you are currently
viewing. Press Alt-F11 or go to "File | Use Unit" to
select the splashscreen unit and hit Ok. Now you can add
where ever you want the code to close the splashscreen.
(I personally prefer the onCreate event of the main form)

------ METHOD 2:
I only use this one if the loading of the mainform takes
subtantial time:

I have both forms auto-create. Obviously, the user won't
see the mainform until the onCreate event has finished.
Therefore you can use the form linking (see above) in the
most simple way, link the splashscreen to the mainform and
just add as the last line of code of the onCreate event the
something like mySplash.Close; or mySplash.Hide; if you
plan to store variables there for other units.

This will cause the splashscreen to disappear as the
mainform appears.

Back to Embarcadero: Delphi FAQ Index
Back to Embarcadero: Delphi Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close