Breaking

Search Here

10 November 2014

Progress Bar


It is Defind as the Display the status from how match work is completed.

A Progress Bar control is used to represent the progress of a lengthy operation that takes time where a user must wait for the operation to be finished. 

C# progressbar

Progress Bar controls are used whenever an operation takes more than a short period of time. The Maximum and Minimum properties define the range of values to represent the progress of a task.

Minimum : Sets the lower value for the range of valid values for progress.

Maximum : Sets the upper value for the range of valid values for progress.

Value : This property obtains or sets the current level of progress.
By default, Minimum and Maximum are set to 0 and 100. As the task proceeds, the Progress Bar fills in from the left to the right. To delay the program briefly so that you can view changes in the progress bar clearly.

The following C# program shows a simple operation in a progress bar .

Full Source C#
 
using System;
using System.Drawing;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
  public partial class Form1 : Form
  {
      public Form1()
      {
          InitializeComponent();
      }
      private void button1_Click(object sender, EventArgs e)
      {
          int i;
          progressBar1.Minimum = 0;
          progressBar1.Maximum = 200;
          for (i = 0; i <= 200; i++)
          {
              progressBar1.Value = i;
          }
      }
  }
}

No comments:

Post a Comment

Hello all, if you have any doubt feel free comment

Comments