Custom Progress Bar In Splash Screen Using C#

Introduction

In this article, we will discuss splash screen with custom progress bar. In this world of internet and computers, we use many types of websites, games, and software every day and splash screen is for sure used in all these software. But do you know what is a splash screen and why we use splash screen? The splash screen plays an important role in the first impression and robust the identity of the brand. The splash screen is just a launch screen. It does not contain any detailed information,  It shows only the logo of a company or the name of a brand or any image, etc.

Splash screen with custom progress bar

Let's talk about progress bar. The progress bar shows how far the user is in process. The splash screen is an Introduction screen of software whenever we open a software. Then the first screen we see that covers the screen is called splash screen. The main application starts only after the splash screen is loaded.

How to create splash screen

Creating a splash screen is very easy, so let's start creating our splash screen.

Step 1

Now open your visual studio and create a new project in windows forms app (.NET Framework) select and then click on next button.

Step 2

Now go to the solution explorer after the project is created and right click the solution name then click on Manage NuGet Packages.

 

Step 3

Search the circular progress bar and click on it.

Step 4

Now select the version of circular progressbar --- version 2.2.O and install the circular progressbar.

Step 5 

Click on ok button.

Step 6

After installation close this and go to the toolbox and search the circular progressbox and click on it.

Step 7

Right click on circular progressbar and go to properties and change some properties.

  • Text = blank.
  • Superscript text= blank.
  • Style= continuous.
  • Size=200,200.
  • Progress width=6.
  • Progress color=192,0,0.
  • Outer color=255,192,192.
  • Inner color= black.
  • Font= modernNo.20,bold,36.
  •  Backcolor= black.
  • Name=progressBar.

Now we have to go properties of window from right click on it and change its some properties.

  • Backcolor=black
  • Cursor=waitcursor.
  • Form borderstyle=none.
  • Size=800,450.
  • Start position= centerscreen.
  • Opacity=90%.

Step 8 

Add label, right-click on it and go to properties and change some properties.

  • Text= your application name.
  • Forecolor=red.
  • Font=MS Reference Sans Serif,Regular,16.

Step 9 

Add another label and change some properties.

  • Text=loading.......
  • Font=MS Reference Sans Serif,Regular,16.

Step 10

Add another label and change some properties.

  • Text=your copyright text.
  • Font=MS Reference Sans Serif,Regular,16.

Now adjust all these in correct way.

Step 11

Search timer in toolbox and add timer and change enabled properties true.

Now add one window form and rename as form this is the form that will show after the splash screen ends.

Double click on the form to create form load event and set

progressBar.Value=0. This will start the progressbar value from zero

public Form1() {
    InitializeComponent();
    progressBar.Value = 0;
}
private void Form1_Load(object sender, EventArgs e) {}

Now double click on the timer to create a timer tick event. We will increment the value of the progressbar by +2 so that the progressbar run at a speed of +2.

Now we have to check if progressbar.value is equal to 100 then we will make the timer enabled false.

Then we have to create object of that windows application. Which we want to show after the splash screen and hide the splash screen.

private void timer1_Tick(object sender, EventArgs e) {
    progressBar.Value += 2; //we will increment the value of the progressbar by +2
    progressBar.Text = progressBar.Value.ToString() + "%";
    if (progressBar.Value == 100) {
        timer1.Enabled = false;
        login s = new login(); // create the object of of login
        s.Show(); // to show the login form
        this.Hide(); // to hide this screen 
    }
}

Output

This is the splash screen and its works like this 

Conclusion

This article is all about splash screen with proper codes to understand the concept of splash screen. When a user open your application you have a chance to impress or disappoint the user from your splash screen.

Thanks, I hope this will help you.


Similar Articles