# Adding a Progress Bar

## Content



You can easily add a progress bar by using the [C1ProgressBar](/componentone/api/win/online-winpack/dotnet-framework-api/C1.Win.C1Win7Pack.4.8/C1.Win.C1Win7Pack.C1TaskDialog.C1ProgressBar.html) class and members to customize the progress bar. A progress bar can be used to indicate the progress of a lengthy operation. The progress bar consists of an area that is filled from left to right as an operation progresses.

### In the Properties Window

Complete the following steps to make the progress bar visible:

1.  On the Form in Design view, click once on the **C1TaskDialog** component to select it.
2.  Navigate to the Properties window and locate and expand the **ProgressBar** item.
3.  Click the drop-down area next to the **State** item and select **Indeterminate**.
4.  Click the drop-down area next to the **Visible** item and select **True**.

### In Code

The following code makes the progress bar visible:

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in Visual Basic

DOC-SUMMARY-TAG-CLOSE

```vbnet
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    C1TaskDialog1.ProgressBar.State = TaskDialogProgressBarState.Indeterminate
    C1TaskDialog1.ProgressBar.Visible = True
End Sub
```

DOC-DETAILS-TAG-CLOSE

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in C#

DOC-SUMMARY-TAG-CLOSE

```csharp
public Form1()
{
    InitializeComponent();
    c1TaskDialog1.ProgressBar.State = TaskDialogProgressBarState.Indeterminate;
    c1TaskDialog1.ProgressBar.Visible = true;
}
```

DOC-DETAILS-TAG-CLOSE

### When You've Accomplished

In this topic you've made the progress bar visible in a dialog box and set the progress bar's state.