How to create a splash screen with progress loading in C# windows application?

Posted by Prabu_Spark under ASP.NET on 7/17/2013 | Points: 10 | Views : 19059 | Status : [Member] | Replies : 2
Hi sir,
Tell me the steps to create a splash screen with progress loading in C# windows application. Kindly give me the solution for this problem.

With regards,
J.Prabu.
[Email:prbspark@gmail.com]



Responses

Posted by: Raj.Trivedi on: 7/20/2013 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hello

You need to add a Form and then you can use the following code

Add 2 labels on that form 1 for storing the PC name.Name the label as lblPcName and another to show what is loading lblLoading

add 4 Timers and then use the code

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;

namespace School
{
public partial class Splash : Form
{

public Splash()
{
InitializeComponent();
}

private void Splash_Load(object sender, EventArgs e)
{
lblPcName.Text = System.Environment.MachineName;
Thread.Sleep(1000);
timer1.Enabled = true;
}

private void timer1_Tick(object sender, EventArgs e)
{
lblLoading.Text = "Loading Environment...";
timer1.Enabled = false;
timer2.Enabled = true;
Thread.Sleep(1000);
}

private void timer2_Tick(object sender, EventArgs e)
{
lblLoading.Text = "Initializing Tools... ";
timer2.Enabled = false;
timer3.Enabled = true;
Thread.Sleep(1000);
}

private void timer3_Tick(object sender, EventArgs e)
{
lblLoading.Text = "Building Workspace...";
timer3.Enabled = false;
timer4.Enabled = true;
Thread.Sleep(1000);
}

private void timer4_Tick(object sender, EventArgs e)
{
Thread.Sleep(1000);
timer4.Enabled = false;
yourform objform = new yourform();
this.Hide();
yourform .Show();
}

}
}


Regard's
Raj.Trivedi
"Sharing is Caring"
Please mark as answer if your Query is resolved

Prabu_Spark, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Phagu007 on: 7/20/2013 [Member] Starter | Points: 25

Up
0
Down
You can use this code in programm for progress bar in create splash screen
public int Progress
{
get
{
return this.progressBar1.Value;
}
set
{
this.progressBar1.Value = value;
}
For more detail http://social.msdn.microsoft.com/Forums/windows/en-US/8af9fd3e-f679-40b4-976a-46f42319e9a5/splash-screen-in-c

Prabu_Spark, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response