ComponentOne Windows 7 Control Pack for WinForms
Windows 7 Control Pack for WinForms Task-Based Help / C1TaskDialog Task-Based Help / Adding a Progress Bar
In This Topic
    Adding a Progress Bar
    In This Topic

    You can easily add a progress bar by using the C1ProgressBar 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:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    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
    

    To write code in C#

    C#
    Copy Code
    public Form1()
    {
        InitializeComponent();
        c1TaskDialog1.ProgressBar.State = TaskDialogProgressBarState.Indeterminate;
        c1TaskDialog1.ProgressBar.Visible = true;
    }
    

    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.