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

x
?
Solved

Splash Screen pausing

Posted on 1998-01-14
5
Medium Priority
?
269 Views
Last Modified: 2010-04-04
Here is the code from my Project  Source.

Q. What I would like to do is delay the splash screen (Form_Splash)a bit longer?

The program is small, and the initialisation of the  app. takes a second or two.

program Topo;

uses
  Forms,
  Main in 'Main.pas' {MainForm},
  Errors in 'Errors.pas',
  WriteFld in 'WriteFld.pas',
  About in 'About.pas' {AboutBox},
  Syntax in 'Syntax.pas',
  ReadFld in 'ReadFld.pas',
  DEG_DMS in 'DEG_DMS.pas',
  CodeTable in 'CodeTable.pas' {CodeForm},
  Unit1 in 'Unit1.pas' {Form_Splash},
  WriteObs in 'WriteObs.pas',
  DataCheck in 'DataCheck.pas',
  ReadObs in 'ReadObs.pas',
  asprev in 'Asprev.pas' {PagePreview};

{$R *.RES}

begin
  Application.Initialize;

  Form_Splash := TForm_Splash.Create(Application);
  Form_Splash.Show;
  Form_Splash.Refresh;

  Application.CreateForm(TMainForm, MainForm);
  Application.CreateForm(TAboutBox, AboutBox);
  Application.CreateForm(TCodeForm, CodeForm);
  Application.CreateForm(TForm_Splash, Form_Splash);
  Application.CreateForm(TPagePreview, PagePreview);

  Form_Splash.Hide;
  Form_Splash.Free;

  Application.Run;
end.
0
Comment
Question by:engtech
[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
  • 3
  • 2
5 Comments
 
LVL 8

Accepted Solution

by:
ZifNab earned 120 total points
ID: 1356595
Put a timer on the splashscreen.
In the OnActivate event, start the timer.
Put at the ontimer event (of TTimer)

procedure TForm_Splash.OnTimer (...);
begin
 Hide;
 Close;
end;

Remove Form_Splash.Hide and Form_Splash.Free

Regards,
Zif.

More info, just ask.
 
0
 

Author Comment

by:engtech
ID: 1356596
Thanks for the quick response
0
 

Author Comment

by:engtech
ID: 1356597
Hello, back again, a slight problem after following what you say - or me either missing something:

After removing Form_Splash.Hide and Form_Splash.Free from the Project Source, placing a timer on the splash form and on Form_Splash.OnActivate event goto procedure OnTimer with code Hide; Close; I get an error of
  "Cannot change Visible in OnShow or OnHide" + a couple of Violation Errors thrown in! Please assist

Ham.
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1356598
Oops, not so good. Here is a working code example.

In project source :

begin
  Application.Initialize;
  Splashform := TSplashForm.Create(Application);
  SplashForm.Show;
  Splashform.Update;
  Application.Title := 'SENSI-Site';
  Application.Helpfile := 'Sensite.hlp';
  Application.CreateForm(TfMaster, fMaster);
  Application.CreateForm(TKeyDlg, KeyDlg);
  Application.Run;
end.

In splashForm :

unit Splash;

interface

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

type
  TSplashForm = class(TForm)
    Panel1: TPanel;
    Image1: TImage;
    Timer1: TTimer;
    procedure Timer1Timer(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  SplashForm: TSplashForm;

implementation

{$R *.DFM}

procedure TSplashForm.Timer1Timer(Sender: TObject);
begin
 Close;
end;

end.

This should work, because it's in one of my projects i'm working on.

Good luck,

If it doesn't work, just ask again and give some source code to illustrate the possible problem.

Regards,
Zif.
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1356599
PS : OnActivate isn't needed if in designtime timer property 'enabled' is set to true.
PPS : Hide isn't needed because you close immediately.


0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

661 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