ComponentOne ProgressBar for ASP.NET Web Forms
Task-Based Help / Customizing Label / Aligning Label
In This Topic
    Aligning Label
    In This Topic

    By default, the C1ProgressBar control's label is aligned in the center of the control. In this topic, you will learn how to change the alignment of the label in Design view, in Source view, and in code.

    Aligning the Label in Design View

    Complete the following steps:

    1. Click the Design button to enter Design view.
    2. Right-click the C1ProgressBar control to open its context menu and select Properties.The Properties window opens with the C1ProgressBar control's properties in focus.
    3. Locate the LabelAlign property, click its drop-down arrow, and select East from the list.
    4. Press F5 to run the project and observe that the label now appears on the right side of the control.

    Aligning the Label in Source View

    Complete the following steps:

    1. Click the Source button to enter Source view.
    2. Add LabelAlign = 'East' to the <cc1:C1ProgressBar> tag so that the markup resembles the following:
      <cc1:C1ProgressBar ID="C1ProgressBar1" runat="server" LabelAlign="East" />
    3. Press F5 to run the project and observe that the label now appears on the right side of the control.

    Aligning the Label in Code

    Complete the following steps:

    1. On the Visual Studio toolbar, click View | Code to enter code view.
    2. Import the following namespace into your project:

      Visual Basic

      Visual Basic
      Copy Code
      Imports C1.Web.Wijmo.Controls.C1ProgressBar

      C#

      CS
      Copy Code
      using C1.Web.Wijmo.Controls.C1ProgressBar;
    3. Align the label by placing the following code in the Page_Load event:

      Visual Basic

      Visual Basic
      Copy Code
      C1ProgressBar1.LabelAlign = LabelAlign.East

      C#

      C#
      Copy Code
      C1ProgressBar1.LabelAlign = LabelAlign.East;
    4. Press F5 to run the project and observe that the label now appears on the right side of the control.

    10.pngThis Topic Illustrates the Following:

    In this topic, you aligned the C1ProgressBar control's label to the right side of the control. The result of this topic resembles the following:

    See Also