Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Splash Screen Example

Tags:

c#

I only want a simple Splash Screen Example.

Get the Code, Insert my picture, add 2 lines of code to load and finish.

But all I can google is so complex, that is too much. I only want a form with a picture that goes more and more transparent until it hides automaticly and my window is shown.

I tried the "prettygoodsplashscreen" from Codeproject, but don't work for me.

Lang is c#.net 2.0

like image 278
PassionateDeveloper Avatar asked Mar 16 '10 15:03

PassionateDeveloper


People also ask

What does splash screen look like?

A splash screen is a graphical control element consisting of a window containing an image, a logo, and the current version of the software. A splash screen can appear while a game or program is launching. A splash page is an introduction page on a website.

What do you put on a splash screen?

Usually consisting of a company logo or name, a branded background image or graphic, and an optional loading indicator or animation, splash screens make a bold first impression and build brand awareness.

What is splash screen in Android?

Android Splash Screen is the first screen visible to the user when the application's launched. Splash screen is one of the most vital screens in the application since it's the user's first experience with the application.

What is meant by splash screen?

an image that appears on the screen of a computer, mobile phone, or other electronic device when it is first switched on, or when an app or program is starting: The splash screen shows an animated company logo that bounces around for a few seconds.


2 Answers

Creating the splash screen can be as simple or complex as you make/want it to be.

private void Form1_Load(object sender, System.EventArgs e)
{
    // Display the splash screen
    var splashScreen = new SplashForm();
    splashScreen.Show()

    // On the splash screen now go and show loading messages
    splashScreen.lblStatus.Text = "Loading Clients...";
    splashScreen.lblStatus.Refresh();

    // Do the specific loading here for the status set above
    var clientList = _repository.LoadClients();

    // Continue doing this above until you're done

    // Close the splash screen
    splashScreen.Close()
}

Obviously the Splash Screen itself is something that you'd have to decide how you want it to look...

like image 175
Richard Avatar answered Nov 15 '22 04:11

Richard


In order for your splash screen to be areal splash screen, it shouldn't have other code than displaying about what it's doing (loading clients, for instance) or show the progress of application startup through a ProgressBar control.

Here are the steps:

  1. Instantiate a BackgroundWorker for which you will launch the loading within the BackgroundWorker.DoWork() method;
  2. Within your main Form_Load() event, call BackgroundWorker.RunWorkerAsync() method;
  3. Still in your Form_Load() event, after your call to RunWorkerAsync(), instantiate and display your splash screen to your user SplashForm.ShowDialog()
  4. Report progress from within your LoadClient() method, for instance, with the BackgroundWorker.ProgressChanged() event (you may also report what it is your BackgroundWorker is doing ("loading clients...");
  5. In your RunWorkerCompleted() event, you may Splash.Close() your splash screen form.

I shall add some further details later on. Have to go now.

like image 38
Will Marcouiller Avatar answered Nov 15 '22 03:11

Will Marcouiller