ComponentOne Windows 7 Control Pack for WinForms
Working with Windows 7 Control Pack for WinForms / Working with C1TaskbarButton / Taskbar Button Elements / Taskbar Button Progress Indicator
In This Topic
    Taskbar Button Progress Indicator
    In This Topic

    The C1TaskbarButton control includes a progress indicator. The progress indicator is visible on the taskbar button; it can be used to communicate the progress of an operation, or it can be used to convey that an ongoing operation is in progress. The progress bar always fills from the right-to-left on the taskbar button.

    States

    The progress bar can be set to one of four states, which are as follows:

    State Description Example
    Indeterminate The Indeterminate state is what's commonly referred to as the "marquee" style.. It indicates an ongoing process by continuously animating the progress bar indicator rolling across the screen. The progress indicator in the Indeterminate state will always be green.
    Normal The Normal state uses a green progress indicator that only advances when a value has changed. It indicates to users that the operation is still processing as expected whilst giving them an indication of the progress of the operation.
    Error The Error state changes the color of the progress bar indicator to red, which indicates to the user that there is an issue with the operation.
    Paused The Paused state changes the color of the progress bar's indicator to yellow, which indicates that the operation is currently paused. This is commonly used when a user initiates a pause or when the a user must interact with something to advance the operation.

    Maximum Value

    You can set a value of the complete operation by setting the Maximum property to a number. By default, the Maximum property is set to 100.

    Value

    The progress bar's value is set by the Value property. If you wanted to set the value to the value of a trackbar, for example, you would add the following code in the trackbar's Scroll event:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    C1TaskbarButton1.ProgressIndicator.Value = trackBar1.Value
    

    To write code in C#

    C#
    Copy Code
    c1TaskbarButton1.ProgressIndicator.Value = trackBar1.Value;
    

    Show and Hide Methods

    The C1ProgressIndicator class contains Show and Hide methods, making it simple for you to make progress bars visible and invisible to users.

    To write code in Visual Basic

    Visual Basic
    Copy Code
    Private Sub progressCheckBox_CheckedChanged(sender As Object, e As EventArgs)
           If progressCheckBox.Checked Then
                  taskbarButton.ProgressIndicator.Show()
           Else
                  taskbarButton.ProgressIndicator.Hide()
           End If
    End Sub
    

    To write code in C#

    C#
    Copy Code
    private void progressCheckBox_CheckedChanged(object sender, EventArgs e)
    {
         if (progressCheckBox.Checked)
         {
              taskbarButton.ProgressIndicator.Show();
         }
         else
         {
              taskbarButton.ProgressIndicator.Hide();
         }
    }