Monday, July 26, 2010

Functionality of Progress Bar.


Write a Program to use the functionality of progress bar.



using System;
using System.Windows.Forms;

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

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

        private void timer1_Tick(object sender, EventArgs e)
        {
            progressBar1.Value = progressBar1.Value+10;
            if (progressBar1.Value >= 100)
            {
                timer1.Stop();
                progressBar1.Visible = false;
                MessageBox.Show("Process Completed");
            }
        }
    }
}

No comments:

Post a Comment