# Adding a Progress Indicator to the Taskbar Button

## Content



This topic illustrates how to use the [C1TaskbarButton](/componentone/api/win/online-winpack/dotnet-framework-api/C1.Win.C1Win7Pack.4.8/C1.Win.C1Win7Pack.C1TaskbarButton.html) control's progress indicator. In this tutorial, you'll set the value of the progress indicator to the value of a track bar.

Complete the following steps:

1.  Add a C1TaskbarButton control and a **TrackBar** control to your form.
2.  In the Properties window, set the **TrackBar** control's **Maximum** property to "100" so that its maximum value is the same as the progress indicator's default value.
3.  With the **TrackBar** control still selected in the Properties window, double-click the **Events** button and then double-click the Scroll event to add a **Scroll** event handler to Code view.
4.  Add the following code to the **trackBar1\_Scroll** event handler:
    
    DOC-DETAILS-TAG-OPEN
    
    DOC-SUMMARY-TAG-OPEN
    
    To write code in Visual Basic
    
    DOC-SUMMARY-TAG-CLOSE
    
    ```vbnet
    Private Sub trackBar1_Scroll(sender As Object, e As EventArgs)
       C1TaskbarButton1.ProgressIndicator.Value = trackBar1.Value
       C1TaskbarButton1.ProgressIndicator.Show()
    End Sub
    ```
    
    DOC-DETAILS-TAG-CLOSE
    
    DOC-DETAILS-TAG-OPEN
    
    DOC-SUMMARY-TAG-OPEN
    
    To write code in C#
    
    DOC-SUMMARY-TAG-CLOSE
    
    ```csharp
    private void trackBar1_Scroll(object sender, EventArgs e)
       {
           c1TaskbarButton1.ProgressIndicator.Value = trackBar1.Value;
           c1TaskbarButton1.ProgressIndicator.Show();
       }
    ```
    
    DOC-DETAILS-TAG-CLOSE
    
5.  Press F5 to run the application and slide the track bar. Observe that the progress indicator on the taskbar button advances as you slide the track bar.

<br />![](https://cdn.mescius.io/document-site-files/images/88084ada-ce7b-4ec0-9f66-d851989d7cf2/imagesext/image10_1.png)