26 November 2013

ProgressBar Control in C#.Net

A ProgressBar control is used to represent the progress of operation that takes time to complete operation where a user has to wait for the operation to be finished.

Drag and drop ProgressBar Control and a button from toolbox on the window Form.
 

By default maximum value of ProgressBar is set 100 and minimum value is set 0 you can change this value.
Code:

Write code on button click event.
 
Double click on Button Click event.

private void button1_Click_1(object sender, EventArgs e)
{
            while (progressBar1.Value < 100)
                progressBar1.Value += 5;
}

Run the application :
 

When you click show button then Progress Bar will start.


 

No comments:

Post a Comment