Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Splashscreen in delphi!

hi

i need some help on making a splashscreen in delphi before my orinal form pops up
can u help me?

Comments

  • zibadianzibadian Posts: 6,349Member
    : hi
    :
    : i need some help on making a splashscreen in delphi before my orinal form pops up
    : can u help me?
    :
    :
    That is not very difficult. Just create the splash form as you would any other form. Then you'll need to remove it from the auto-create forms list (Project Options). The last thing you need to do is manually create the form inside the project file itself:
    [code]
    program Project1;

    uses
    Forms,
    Unit1 in 'Unit1.pas' {MainForm},
    Unit2 in 'Unit2.pas' {SplashForm};

    {$R *.RES}

    begin
    SplashForm := TSplashForm.Create(nil); // Create splashform
    try
    SplashForm.Show; // show the splash
    Application.Initialize; // continue with creation of application &
    Application.CreateForm(TForm1, Form1); // forms
    finally
    SplashForm.Hide; // Hide the splashform
    SplashForm.Free; // and free it
    Application.Run; // Start the application normally
    end;
    end.
    [/code]
    I protected the splashform from any exceptions which might occur during the start-up of the program. This way it will always be removed from sight and the program will always show normally after that.
  • stealthcoderstealthcoder Posts: 1Member
    :hi, my name's Edward.I too was a newbie in Delphi (I just got it in this 3rd term in my university) perhaps my suggestions can help... but I didn't guarantee it :D
    : You can start by adding a panel/or other components that can contain a picture on your main form then set the form visible default to false. Next, on the oncreate event on your main form, set the visible property of the image container to true. You must also put a timer that delays for a few seconds(I recommend using a counter variable), so that your splash screen doesn't just disappear after a glance :p. Set the enabled property of timer "true" on default. Finally, set its enabled property to false,the main form property visible to true, and the image container visible property to false. Then... TADAAA! You got your splash screen image emerged for a moment before your main form appears. If I don't made a mistake... :)
    :Anyway, please E-mail me if my tip was whether useful or useless :p I want to know how it ended up.:)
    :please forgive me if I made a mistake... I don't know if a different version of Delphi affect the way I mentioned. Personally,I have both Delphi 5 and 7 at home, but I hardly use them 'cause I'm concentrating in a small project J2ME game development... Btw, If you have a friend that was good in art/word art, better ask her/him to create a unique pic for your splash screen then convert it to an image using a scanner device :|. I've asked one of my friend and it looks great :D.
    : Thanx. My E-mail : youth_heartbeat@yahoo.com
    :

  • softmansoftman Posts: 157Member
    Hi!

    I think this method to creating a Splash Screen is great! What I would like add to this, that the form is not automatically paints. So if you put some picture into your splash form, just to be sure to be painted, add SplashForm.Repaint after SplashForm.Show.

    Softman.

    : : hi
    : :
    : : i need some help on making a splashscreen in delphi before my orinal form pops up
    : : can u help me?
    : :
    : :
    : That is not very difficult. Just create the splash form as you would any other form. Then you'll need to remove it from the auto-create forms list (Project Options). The last thing you need to do is manually create the form inside the project file itself:
    : [code]
    : program Project1;
    :
    : uses
    : Forms,
    : Unit1 in 'Unit1.pas' {MainForm},
    : Unit2 in 'Unit2.pas' {SplashForm};
    :
    : {$R *.RES}
    :
    : begin
    : SplashForm := TSplashForm.Create(nil); // Create splashform
    : try
    : SplashForm.Show; // show the splash
    : Application.Initialize; // continue with creation of application &
    : Application.CreateForm(TForm1, Form1); // forms
    : finally
    : SplashForm.Hide; // Hide the splashform
    : SplashForm.Free; // and free it
    : Application.Run; // Start the application normally
    : end;
    : end.
    : [/code]
    : I protected the splashform from any exceptions which might occur during the start-up of the program. This way it will always be removed from sight and the program will always show normally after that.
    :

Sign In or Register to comment.