ComponentOne Windows 7 Control Pack for WinForms
Windows 7 Control Pack for WinForms Task-Based Help / C1TaskbarButton Task-Based Help / Working with the Taskbar Button / Adding a Progress Indicator to the Taskbar Button
In This Topic
    Adding a Progress Indicator to the Taskbar Button
    In This Topic

    This topic illustrates how to use the C1TaskbarButton 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:

      To write code in Visual Basic

      Visual Basic
      Copy Code
      Private Sub trackBar1_Scroll(sender As Object, e As EventArgs)
         C1TaskbarButton1.ProgressIndicator.Value = trackBar1.Value
         C1TaskbarButton1.ProgressIndicator.Show()
      End Sub
      

      To write code in C#

      C#
      Copy Code
      private void trackBar1_Scroll(object sender, EventArgs e)
         {
             c1TaskbarButton1.ProgressIndicator.Value = trackBar1.Value;
             c1TaskbarButton1.ProgressIndicator.Show();
         }
      
    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.