![]() |
|
|
|||||||
![]() |
|
|
Thread Tools | Rate Thread |
|
|
PM User | #1 |
|
New to the CF scene Join Date: Aug 2009
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
C# splash screen help
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 Code:
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();
}
}
}
}
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Rate This Thread | |
|
|