Board index » delphi » Problem with Splash screen

Problem with Splash screen

Hello !
-------

I want to display a splash-screen while my application connects
to a ODBC datasource and retrieves information.

I have created a form with some lables and graphics on it, and calls:

  Application.CreateForm(TSplashLoadForm, SplashLoadForm);
  splashLoadForm.Show;
  splashLoadForm.Status.Caption :='Loading project data .....';

And when finished:

  splashLoadForm.Hide;
  splashLoadForm.Free;

The form is displayd, but the lables and graphics are not shown !
It looks like the application continues to run, and do not show
all components on the form.

Fredrik

 

Re:Problem with Splash screen


I had a similar problem displaing a SplashScreen while doing a re-index
operation
I added a  "Application.ProcessMessages;" call after the
"Splashscreen.show" call
and this gave my form time to completely display.
Bob Harman
EMail: RHarman313.aol.com

Re:Problem with Splash screen


On Sun, 14 Apr 1996 12:56:00 +0200, Fredrik Viken

Quote
<fvi...@stud.unit.no> wrote:
>Hello !
>-------

>I want to display a splash-screen while my application connects
>to a ODBC datasource and retrieves information.

>I have created a form with some lables and graphics on it, and calls:

>  Application.CreateForm(TSplashLoadForm, SplashLoadForm);
>  splashLoadForm.Show;
>  splashLoadForm.Status.Caption :='Loading project data .....';

>And when finished:

>  splashLoadForm.Hide;
>  splashLoadForm.Free;

>The form is displayd, but the lables and graphics are not shown !
>It looks like the application continues to run, and do not show
>all components on the form.

>Fredrik

You will need to give the form some time load and display, I usally
add a loop with Application.ProcessMessages in it.

Brien King
bk...@primenet.com

Re:Problem with Splash screen


Quote
Fredrik Viken <fvi...@stud.unit.no> wrote:
>Hello !
>-------
>I want to display a splash-screen while my application connects
>to a ODBC datasource and retrieves information.

[snip]

Quote
>The form is displayd, but the lables and graphics are not shown !
>It looks like the application continues to run, and do not show
>all components on the form.

Hi, Fredrik:

I tell the splashscreen to update itself, like this:

{$R *.RES}
var SplashScreen : TfrmSplash;
begin
  SplashScreen := TfrmSplash.Create(Application);
  try
    SplashScreen.Show;
    SplashScreen.Update;    {this will ensure that all the components
                             on the form get drawn}
    SplashScreen.Timer1.Enabled := True;  {I can change the timer's

                                        interval to guarantee that
                                        it's visible in all my apps
                                        (even small ones).}

    Application.CreateForm(TfrmMain, frmMain);
   While (SplashScreen.Timer1.Enabled) do
      Application.ProcessMessages;
   SplashScreen.Close;
  finally
    SplashScreen.Free;
    Application.Run;
  end;

Hope this helps.

Kevin

Re:Problem with Splash screen


On Sun, 14 Apr 1996 12:56:00 +0200,
Fredrik Viken <fvi...@stud.unit.no> wrote (a crit):

Quote
>I have created a form with some lables and graphics on it, and calls:
>  Application.CreateForm(TSplashLoadForm, SplashLoadForm);
>  splashLoadForm.Show;
>  splashLoadForm.Status.Caption :='Loading project data .....';
>And when finished:
>  splashLoadForm.Hide;
>  splashLoadForm.Free;
>The form is displayd, but the lables and graphics are not shown !
>It looks like the application continues to run, and do not show
>all components on the form.

If you add:

  SplashLoadForm.Update;

after: SplashLoadForm.Show

your graphics will most probably be displayed.

Georges Rosset - Geneva/Switzerland
-------------------------------------------------------------------------
rosse...@iprolink.ch

Re:Problem with Splash screen


Quote
Fredrik Viken <fvi...@stud.unit.no> writes:
> Hello !
> -------

> I want to display a splash-screen while my application connects
> to a ODBC datasource and retrieves information.

> I have created a form with some lables and graphics on it, and calls:

>   Application.CreateForm(TSplashLoadForm, SplashLoadForm);
>   splashLoadForm.Show;
>   splashLoadForm.Status.Caption :='Loading project data .....';

> And when finished:

>   splashLoadForm.Hide;
>   splashLoadForm.Free;

> The form is displayd, but the lables and graphics are not shown !
> It looks like the application continues to run, and do not show
> all components on the form.

> Fredrik

You need a "splashLoadForm.Update" to force the screen to
finish painting itself.

Hope this helps

Mike Sutton

Other Threads