PDA

View Full Version : C# splash screen help


tunacha
11-07-2009, 03:45 PM
Well i didnt see a forum dedicated to c# so i decided i would post this here

What uim trying to do is on the progressbar reaching 100 Close the form and open a new one
and when i try to do this with the code i am using it just repeatedly opens the second form over and over, ive tried placing this elsewhere in the code but the same thing happens
Any help would be apreciated
and sorry for spelling mistakes

namespace splash
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();

}

private void Form1_Load(object sender, EventArgs e)
{
timer1.Enabled = true;
}

private void timer1_Tick(object sender, EventArgs e)
{
progressBar1.Maximum = 100;
progressBar1.Minimum = 0;
progressBar1.Step = 1;
progressBar1.PerformStep();
label1.Text = progressBar1.Value.ToString() + "% Loaded";
if (progressBar1.Value == 100)
{
Form1 f1 = new Form1();
Form2 f2 = new Form2();
f1.Close();
f2.Show();

}

}

}
}