Recent

Author Topic: SplashForm - what I have to do?  (Read 8250 times)

JanH

  • Guest
SplashForm - what I have to do?
« on: February 27, 2006, 12:27:58 pm »
What else I have to do to see a splash form on loading my app? I have created a form, set its formstyle to fsSplash, put a label on it and saved it.
But when I start the program, OnShow of this splash form never be  called. :-(

glober

  • Full Member
  • ***
  • Posts: 130
SplashForm - what I have to do?
« Reply #1 on: February 28, 2006, 03:35:01 am »
Try following this guide: http://delphi.about.com/od/formsdialogs/a/splashscreen.htm . The only thing I recommend you change is to replace

     SplashScreen := TSplashScreen.Create(Application);

with

     SplashScreen := TSplashScreen.Create(nil);

This doesn't kill the application under Windows, if you free the SplashScreen, If I recall corectly.

HTH

mattias

  • Administrator
  • Full Member
  • *
  • Posts: 207
    • http://www.lazarus.freepascal.org
SplashForm - what I have to do?
« Reply #2 on: February 28, 2006, 11:58:51 am »
The Delphi approach will not work on all platforms.

Add this in your .lpr file after the Application.Initialize:

    SplashForm := TSplashForm.Create(nil);
    SplashForm.Show;
    Application.ProcessMessages; // process splash paint message

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2674
SplashForm - what I have to do?
« Reply #3 on: February 28, 2006, 12:16:12 pm »
Maybe note to us:

when using SplashScreen := TSplashScreen.Create(Application);

TApplication can check if the form is a splashform and show it and skip setting it as mainform.
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

JanH

  • Guest
SplashForm - what I have to do?
« Reply #4 on: February 28, 2006, 02:03:38 pm »
thanx for all the help.
I thought there was a mechanism wich shows a splash form automatically.

 

TinyPortal © 2005-2018