Go Back   CodingForums.com > :: Computing & Sciences > Computer Programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Old 11-07-2009, 03:45 PM   PM User | #1
tunacha
New to the CF scene

 
Join Date: Aug 2009
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
tunacha is an unknown quantity at this point
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();
                            
            }

        }
        
    }
}
tunacha is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:56 AM.

Home - Contact Us - Archives - Link to CF - Resources - Top 

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.