In my application, the main form's OnShow method looks like this:

procedure TfrmMain.FormShow(Sender: TObject);
begin
  try

    [...form initialisation code here...]

  finally
    frmSplash.Close;
    frmSplash.Free;
    frmSplash := nil;
  end;
end; { FormShow }

(but take note of Rohit's remark re. the stability of this solution!)

Regards, Paul.

> -----Original Message-----
> From: Juan Manuel Gomez Ramos [SMTP:[EMAIL PROTECTED]]
> Sent: Friday, June 11, 1999 4:40 AM
> To:   Multiple recipients of list delphi
> Subject:      RE: [DUG]:  Welcome image
> 
>   Paul:
> 
>   I tried the code but, where should I free/close the frmSplash form? I
> use this to show the user a "Loading data..." message while the app delays
> opening tables in it's OnCreate event handler.
> 
>   Juan Manuel Gomez Ramos
>   Computer Science student at Havana University
>   email:<[EMAIL PROTECTED]>
>         <[EMAIL PROTECTED]>
>   eFax:(707) 313-0329
>   internet:http://cronos.freeservers.com
> 
>   Hope is faith holding out its hand in the dark.
> 
> On Thu, 10 Jun 1999, Marshall, Paul wrote:
> 
> > If you edit the project's DPR file thus, frmSplash will appear while the
> > application is creating the other forms. You will need to Close and Free
> > frmSplash (and set it to nil) at the end of your main form's FormShow
> > method.
> > 
> >   Application.Initialize;
> >   frmSplash := TfrmSplash.Create(Application);
> >   try
> >     frmSplash.Show;
> >     frmSplash.Update;
> > 
> >     Application.CreateForm(...
> >     Application.CreateForm(...
> >     
> >    Application.Run;
> >   finally
> >     if Assigned(frmSplash)
> >       then frmSplash.Free;
> >     { frmSplash will normally have been freed already }
> >   end;
> > 
> > 
> > > -----Original Message-----
> > > From:     Juan Manuel Gomez Ramos [SMTP:[EMAIL PROTECTED]]
> > > Sent:     Thursday, June 10, 1999 12:36 AM
> > > To:       Multiple recipients of list delphi
> > > Subject:  [DUG]:  Welcome image
> > > 
> > >   How does Delphi shows a welcome image/window while openning its main
> > > window?
> > > 
> > >   Juan Manuel Gomez Ramos
> > >   Computer Science student at Havana University
> > >   email:<[EMAIL PROTECTED]>
> > >         <[EMAIL PROTECTED]>
> > >   eFax:(707) 313-0329
> > >   internet:http://cronos.freeservers.com
> > > 
> > >   Hope is faith holding out its hand in the dark.
> > > 
> > >
> --------------------------------------------------------------------------
> > > -
> > >     New Zealand Delphi Users group - Delphi List -
> [EMAIL PROTECTED]
> > >                   Website: http://www.delphi.org.nz
> >
> --------------------------------------------------------------------------
> -
> >     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
> >                   Website: http://www.delphi.org.nz
> > 
> 
> --------------------------------------------------------------------------
> -
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to