TIP: Click on subject to list as thread! ANSI
echo: delphi
to: STEPHEN WHITIS
from: BRYAN SMITH
date: 1996-09-30 02:25:00
subject: Splash Screens

On 28 Sep 96 Stephen Whitis said to All...
 SW> I can't seem to find any info on creating a spash screen which
 SW> would show on startup.  Can anyone point me in the right
 SW> direction?
If you have web access, you can go to Anders Ohlsson's web site at
http://www.it.kth.se/~ao (which is in Sweden), then move to his Delphi
Hackers Corner and download source for his LAUNCH application.  This
includes a splash screen example.  But in case you do not have web access,
let me summarize how Ohlsson does the splash screen ...
1.  The splash screen is created as a normal form named SplashScreen, the
form's properties include  BorderStyle=bsNone, Position=poScreenCenter,
BorderIcons all false, and FormStyle=fsStayOnTop.  To get a 3-D look, this
holds a panel with Align=alClient, BevelInner=bvNone, BevelOuter=bvRaised,
BevelWidth=2, and Caption=none.  Load the panel with whatever you wish.
2.  Here is the guts of the .DPR file, with most stuff not relevant to the
splash screen stripped out.  Comments are AO's ...
procedure CreateForms;
begin
  { This makes Delphi's automagic code editing features work a little better 

  Application.CreateForm(TMainForm, MainForm);
  Application.CreateForm(TResourceForm, ResourceForm);
  Application.CreateForm(TInfoForm, InfoForm);
  Application.CreateForm(TAboutForm, AboutForm);
end;
var
  StartTime  : TDateTime;
begin
  try
    SplashForm := TSplashForm.Create(Application); { Create splash screen }
    { Show (and force updating of) the splash screen ... }
    SplashForm.Show;  SplashForm.Update;
    CreateForms; { Create the forms }
    StartTime := Now; { Wait for a few seconds }
    repeat until Now-StartTime > 2.0/24.0/3600.0;
    SplashForm.Hide; { Hide the splash screen }
    Application.Run; { Run the application }
  finally
    SplashForm.Free; { Free the splash screen }
  end;
end.
You might try moving StartTime := Now; ahead of CreateForms;  Note that you
can not use a timer control in the .DPR because there is no form to put it
on.
Maybe somebody can explain why you can not use Application.CreateForm to
create the Splash Form also.  (GPF if you do).  Note that Delphi will
automatically generate such a line, so you have to replace it.
--- PPoint 2.00
---------------
* Origin: Kingston, Canada (1:249/109.11)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.