The most basic splash screen is just an image (more precisely a form with an image) that appears in the center of the desktop screen when the application is loading (and gets hidden when the application is ready for usage).
Splash Screen?There are several types of Splash Screens. The most common splash screens are start up splash screens. The ones you see when an application is loading. These usually display the application's name, author, version, copyright, and image or some icon that uniquely identifies it. If you are a shareware developer, you could use splash screens to remind users to register the program. Some applications use splash screens to display and notify the user of the progress of a time-consuming process (don't want users to think that your program is "dead" if some database task is performing).
Splash Screen!Let's see how to create a simple start up SplashScreen in a few steps:
- Add a new form to your project (select New Form from the File menu in the Delphi IDE).
- Change the Name Property of the Form to something like SplashScreen.
- Change these Properties: BorderStyle to bsNone, Position to poScreenCenter.
- Customize your Splash Screen by adding various components: labels, images, panels, etc. You could first add one TPanel component (Align: alClient), and play around with BevelInner, BevelOuter, BevelWidth, BorderStyle, BorderWidth properties to produce some eye-candy effects.
- Select Project from the Options menu and move the SplashScreen Form from the Auto-create listbox to Available Forms. We'll create a form on the fly and then displaying it before the application is actually opened.
- Select Project Source from the View menu. (Or, Project | View Source).
- Add the following code after the begin statement of the Project Source code (the .dpr file).
Application.Initialize; //this line exists! SplashScreen := TSplashScreen.Create(nil) ; SplashScreen.Show; SplashScreen.Update;
- After the final Application.Create() and before Application.Run statement add:
- That's it. Now run the application. In this example, depending on the speed of your computer, you will barely see your new Splash Screen, but if you have more than one form in your project, the splash screen will certainly show up!
- Ah yes, why have rectangular splash screen forms? Create a custom shaped Delphi form!