![]() |
|||||||||||||||||
|
|
|||||||||||||||||
|
|
|||||||||
|
Delphi |
How to Add a Splash Screen to Your Application
Splash Screens are important to your applications. They provide function while adding to your application's visual appearance and interface. Splash Screens communicate with users of your application. Using Splash Screens in your applications can uniquely distinguish yours from the others. There are many types of Splash Screens. The most common Splash Screens are the ones you see when an application is first being loaded. These usually display the application's name, author, version, copyright, and image or icon that uniqely identifies it. However, some applications use Splash Screens to display and notify the user of the progress of a time-consuming process. An example would be a SplashScreen that communicates the percentage of completetion of a databasetask, file task, or numeric processing tasks. The Progress Splash Screen offers users the courtesy of being informed. You now see the benefits of Splash Screen. Let's show you how to create a simple one for yourself.
*************************************************
{PROJECT1.DPR}
program Project1;
uses
Forms,
Unit1 in 'UNIT1.PAS' {Form1},
Unit2 in 'UNIT2.PAS' {SplashScreen};
{$R *.RES}
var
x: longint;
begin
SplashScreen:= TSplashScreen.Create(Application);
SplashScreen.Show;
SplashScreen.Refresh;;
for x:= 1 to 10000000 do
begin
x:=x;
x:=x;
end;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
*************************************************
{UNIT1.PAS}
unit Unit1;
interface
uses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
Forms, Dialogs, unit2;
type
TForm1 = class(TForm)
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.FormShow(Sender: TObject);
begin
splashscreen.free;
end;
end.
*************************************************
{UNIT2.PAS}
unit Unit2;
interface
uses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
Forms, Dialogs, StdCtrls, ExtCtrls;
type
TSplashScreen = class(TForm)
Panel1: TPanel;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Shape1: TShape;
Shape2: TShape;
Shape3: TShape;
private
{ Private declarations }
public
{ Public declarations }
end;
var
SplashScreen: TSplashScreen;
implementation
{$R *.DFM}
end.
DISCLAIMER: You have the right to use this technical information subject to the terms of the No-Nonsense License Statement that you received with the Borland product to which this information pertains. |
|
|
|
|||||
| Made in Borland® Copyright© 1994-2002 Borland Software Corporation. All rights reserved. Report Piracy, Legal Notices, Privacy Policy Last Modified Thursday, 22-Mar-2001 18:17:02 EST |
|||||