ComponentOne Ribbon for WinForms
Step 4 of 7: Set up the C1StatusBar
C1Ribbon (Classic) Quick Start > Step 4 of 7: Set up the C1StatusBar

The C1StatusBar is displayed at the bottom of the Ribbon Form. The C1StatusBar provides panel styles which are used to provide feedback to the Ribbon end users.

To add panel styles which enable the end-users to see the progress bar in the left pane and the track bar in the right pane, complete the following steps:

  1. Add a ProgressBar to the left status bar pane:
    1. Click C1StatusBar LeftPaneItems to activate the item to enable the floating toolbar.
    2. Click the Actions button. A list of actions is revealed.
    3. Select Add ProgressBar:
    4. Select the progress bar to activate it, and set following properties in the Properties window:
  2. Add a Button to the right status bar pane and modify its properties:
    1. Click C1StatusBar.RightPaneItems to activate the item and to enable the floating toolbar.
    2. Click the Actions button. A list of actions is revealed.
    3. Select Add Button.
    4. Select the button to activate it, and set the following properties in the Properties window:
  3. Add a TrackBar to the right status bar pane and modify its properties:
    1. Click C1StatusBar.RightPaneItems to activate the item and to enable the floating toolbar.
    2. Click the Actions button. A list of actions is revealed.
    3. Select Add TrackBar. The track bar is added to the right status bar pane.
    4. Select the track bar to activate it, and in the Properties window set the Name property to "trackbar".
  4. Adjust the width of the right status bar pane:
    Select the right status bar pane to activate it, and set the C1StatusBar.RightPaneWidth property to 150 in the Properties window.
  5. Add code to enable the left and right status bar pane items:

    In the Code Editor, add the following code to enable the items on the left and right panel:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    ' type the Imports directive for the namespace
    Imports C1.Win.C1Ribbon
     
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 
        trackbar.SmallChange = 1 
        trackbar.LargeChange = 5 
        trackbar.Minimum = 0 
        trackbar.Maximum = 100 
        trackbar.Value = 30 
        AddHandler trackbar.Scroll, AddressOf trackbar_Scroll 
    End Sub 
     
    Sub trackbar_Scroll(ByVal sender As Object, ByVal e As EventArgs) 
        Dim val As Integer = trackbar.Value 
        progressbar.Value = val 
        button.Text = val.ToString + "%" 
    End Sub
    

    To write code in C#

    C#
    Copy Code
    // type the using directive for the namespace
    using C1.Win.C1Ribbon;
     
    private void Form1_Load(object sender, EventArgs e)
    {
        trackbar.SmallChange = 1;
        trackbar.LargeChange = 5;
        trackbar.Minimum = 0;
        trackbar.Maximum = 100;
        trackbar.Value = 30;
        trackbar.Scroll += new EventHandler(trackbar_Scroll);
    }
    void trackbar_Scroll(object sender, EventArgs e)
    {
        int val = trackbar.Value;
        progressbar.Value = val;
        button.Text = val.ToString() + "%";
    }
    

You have successfully added items to the status bar. Next, you will add C1ThemeController component to the application and apply themes.