Thursday, January 10, 2013

Progress Bar in C# Windows Application


How to work Progress Bar in C# Windows Application?




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;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        int i = 15;
        public Form1()
        {
            InitializeComponent();
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            i--;
            if (i > 1)
                progressBar1.PerformStep();
            if (i < 1)
                i = 0;
            if (i == 0)
            {
                timer1.Stop();
                //Login objlogin = new Login();
                //objlogin.Show();
                //this.Hide();
            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {
             timer1.Start();
        }
    }
}

No comments:

Post a Comment

Comment Here..