Aligning the C1ProgressBar Label
By default, the C1ProgressBar control’s label is aligned to the left (if horizontal) or to the top (if vertical) 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. This topic assumes that you have created an ASP.NET AJAX-Enabled Web site containing a ScriptManager control and a C1ProgressBar control.
Aligning the Label in Design View
To align the label, 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 Center from the list.
4. Press F5 to run the project and observe that the label now appears in the center of the control.
Aligning the Label in Source View
To align the label, complete the following steps:
1. Click the Source button to enter Source view.
2. Add LabelAlign = “Center” to the <cc1:C1ProgressBar> tag so that the markup resembles the following:
<cc1:C1ProgressBar ID="C1ProgressBar2" runat="server" LabelAlign="Center" />
3. Press F5 to run the project and observe that the label now appears in the center of the control.
Aligning the Label in Code
To align the label, 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:
Imports C1.Web.UI.Controls.C1ProgressBar
• C#
using C1.Web.UI.Controls.C1ProgressBar;
3. Align the label by placing the following code in the Page_Load event:
C1ProgressBar1.LabelAlign = ProgressBarLabelAlign.Center
• C#
C1ProgressBar1.LabelAlign = ProgressBarLabelAlign.Center;
4. Press F5 to run the project and observe that the label now appears in the center of the control.
This Topic Illustrates the Following:
In this topic, you aligned the C1ProgressBar control’s label to the center. The result of this topic resembles the following:
|