---
title: "ProgressBar in C#"  
description: "A ProgressBar control is used to represent the progress of a lengthy operation that takes time where a user has to wait for the operation to be finish"  
author: "AVADHESH PATEL"  
published: 2012-09-28  
updated: 2014-09-18  
canonical: https://www.mindstick.com/blog/370/progressbar-in-c-sharp  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# ProgressBar in C#

A ProgressBar [control](https://www.mindstick.com/blog/197/asp-dot-net-repeater-control) is used to represent the [progress](https://yourviews.mindstick.com/view/284/devotees-arrived-in-prayagraj-while-work-is-still-in-progress) of a lengthy [operation](https://www.mindstick.com/forum/33917/how-to-callback-operation-using-delegate-in-c-sharp) that takes time where a [user](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server) has to wait for the operation to be finished.

Here I used ProcessBar Dynamically. \

```
using System;using System.Windows.Forms;namespace ProcessBar{    public partial class Form1 : Form    {        public Form1()        {            InitializeComponent();        }         private void btnStart_Click(object sender, EventArgs e)        {            //creating a dynamic ProgressBar is to create an instance of ProgressBar class.            ProgressBar pBar = new ProgressBar();                  //name of process bar            pBar.Name = "progressBar1";              // set height and width of processbar            pBar.Width = 200;             pBar.Height = 20;              //add the ProgressBar to a Form.              Controls.Add(pBar);              //The Dock property is used to set the position of a ProgressBar            pBar.Dock = DockStyle.Bottom;              //The Minimum and Maximum properties define the range of a ProgressBar            pBar.Minimum = 0;             pBar.Maximum = 100;              //The Value property represents the current value of a ProgressBar.            pBar.Value = 70;         }    }
  }
```

\
[Output](https://www.mindstick.com/forum/161319/how-does-the-print-function-handle-output-in-python)

![ProgressBar in C#](https://www.mindstick.com/blogs/427c408f-9e1b-49a7-970a-e3244f43a162/images/e235c0cf-78e1-4eef-ae5e-3175cb84c041.jpg)

---

Original Source: https://www.mindstick.com/blog/370/progressbar-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
