Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a Splash Screen

In my application it takes some time to loan my initial screen(1-2 mins). Since it has so many controls to be filled by Database.

So I need to have a splash screen, it will load(probably with a progress bar) and stays while main form loads. Means in background I need to load main form (better with out showing)

Only main window finishes loading, it notifies to splash, the splash will go off and main will be visible.

I tried to achieve above with several way but no success.

Any one can help me ?

like image 439
Buddhi Dananjaya Avatar asked Jan 17 '26 01:01

Buddhi Dananjaya


2 Answers

look at this Splash screen

and this Splash screen class

like image 164
Serghei Avatar answered Jan 19 '26 14:01

Serghei


FormSplash splash = new FormSplash();

this.BeginInvoke(
    new MethodInvoker(
        () =>
        {
            splash.Show();
        }
    )
);

// main form code here

// at end of loading code
splash.Close();

The above code belongs in Form_Load of the main form.

like image 38
Nahydrin Avatar answered Jan 19 '26 15:01

Nahydrin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!