Setting C1ProgressBar Values
The C1ProgressBar control contains a minimum value, a maximum value, and a value. In this topic, you will change the value of the MinimumValue, MaximumValue, and Value properties from their defaults (0, 100, and 0 respectively) in Design view, in Source view, and in code.
Setting Values in Design View
To set values, 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. In the Properties window, set the following properties:
• Set the MaximumValue property to “300”.
• Set the MinimumValue property to “100”.
• Set the Value property to “150”.
4. Press F5 to run the project and observe that the progress indicator has progressed along a quarter of the task bar. It has increased by a quarter because the control’s value (150) is one-quarter of the way between the minimum value (100) and the maximum value (300).
Setting Values in Source view
To set values, complete the following steps:
1. Click the Source button to enter Source view.
2. Add MinimumValue=”100”, MaximumValue=”300”, and Value=”150” to the <cc1:C1ProgressBar> tag so that the markup resembles the following:
<cc2:C1ProgressBar ID="C1ProgressBar1" runat="server"
ToolTip="Maximum value: {5}" LabelFormatString="{0}" MaximumValue="300"
MinimumValue="100" Value="150" />
3. Press F5 to run the project and observe that the progress indicator has progressed along a quarter of the task bar. It has increased by a quarter because the control’s value (150) is one-quarter of the way between the minimum value (100) and the maximum value (300).
Setting Values in Code
To set values, complete the following steps:
1. To configure animations, complete the following steps:
2. On the Visual Studio toolbar, click View | Code to enter Code view.
3. To set the MaximumValue property, add the following code to the Page_Load event:
C1ProgressBar1.MaximumValue = 300
• C#
C1ProgressBar1.MaximumValue = 300;
4. To set the MinimumValue property, add the following code to the Page_Load event:
C1ProgressBar1.MinimumValue = 100
• C#
C1ProgressBar1.MinimumValue = 100;
5. To set the Value property, add the following code to the Page_Load event:
C1ProgressBar1.Value = 150
• C#
C1ProgressBar1.Value = 150;
6. Press F5 to run the project and observe that the progress indicator has progressed along a quarter of the task bar. It has increased by a quarter because the control’s value (150) is one-quarter of the way between the minimum value (100) and the maximum value (300).
|