Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Closing a splash screen

Posted on 1998-11-06
4
Medium Priority
?
245 Views
Last Modified: 2010-04-04
I'm wanting to show a splash screen whilst my app starts, but how do I close or destroy it once my main form is active?

I've created the splash by using the Create, Show, Update methods within it's own implementation section.

Thanks in advance
Darren
0
Comment
Question by:elkiors
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 8

Accepted Solution

by:
ZifNab earned 40 total points
ID: 1345941
Hi elkiors,

put code in your application source, like :

{$R *.RES}

var Splashscreen : TSplashScreen;

begin
  SplashScreen := TSplashScreen.Create(Self);
  SplashScreen.Show;
  Application.CreateForm(TAllExamplesForm, AllExamplesForm);
  SplashScreen.Hide;
  SplashScreen.Free;
  Application.Run;
end.

ps. you can use timer to let splashscreen see for a while

Zif.
0
 

Author Comment

by:elkiors
ID: 1345942
Hi Zif,

Thanks alot ... although I did need to change it a bit:


var Splashscreen : TSplashScreen;

begin
  SplashScreen := TSplashScreen.Create(Application); {THIS IS NEW- SELF CREATED AN ERROR}
  SplashScreen.Show;
  SplashScreen.Update; {THIS IS NEW OTHERWISE IT WON'T PAINT}
  Application.CreateForm(TAllExamplesForm, AllExamplesForm);
  SplashScreen.Hide;
  SplashScreen.Free;
  Application.Run;
end.

At least this q didn't run around in circles like the one we just finished on the Update Query stuff

Thanks again

Darren

0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1345943
Hi elkiors,

yep, your correct, I made some mistakes in this one, but it's because it's already a long time ago I made a splash-screen and I thought I still knew it from my head .... seems I don't....

Regards, Zif.
0
 

Expert Comment

by:mami
ID: 1345944
I run my splash in the program.dpr

program Pprogran;

uses
  Forms,
  Unit1 in 'Unit1.pas' {Form1},
  splash in 'splash.pas' {Fsplash},

{$R *.RES}

begin
  Fsplash := TFsplash.Create(Application);
  Fsplash.Show;
  Fsplash.update; {To paint the splash screen}
  Application.CreateForm(TForm1, Form1);
  Fsplash.Close;
  Fsplash.Free;
  Application.Title := 'Title';
  Application.Run;
end.

and in the unit splash I write.....

unit splash;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ExtCtrls;

type
  TFsplash = class(TForm)
    Panel1: TPanel;
    Image1: TImage;
    procedure FormActivate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }

    procedure Delay(Num: longint);

  end;

var
  Fsplash: TFsplash;

implementation

{$R *.DFM}

procedure TFsplash.Delay(Num: longint);
var
   tc :longint;
begin
     tc :=GetTickCount;
     repeat
           Application.ProcessMessages;
     until ((GetTickCount-tc) >= Num);
end;

procedure TFsplash.FormActivate(Sender: TObject);
begin
  Brush.Style := bsClear;
  Delay(5000);
end;

end.

Of this manner I can control the time that want that the splash this active.

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question