You can manage the appearance of C1RangeSlider control through various Bar Style options.
Back color of C1RangeSlider bar can be changed at design time or through code.
To change the back color in design time complete the following:
To change the back color at run-time, add the following code in FormLoad event:
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Me.C1RangeSlider1.Styles.BarStyle.BackColor = System.Drawing.Color.Lavender |
To write code in C#
C# |
Copy Code
|
---|---|
this.c1RangeSlider1.Styles.BarStyle.BackColor = System.Drawing.Color.Lavender; |
To change the border color in design time complete the following:
To change the border color at run-time, add the following code in FormLoad event:
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Me.C1RangeSlider1.Styles.BarStyle.BorderColor = System.Drawing.Color.MediumBlue |
To write code in C#
C# |
Copy Code
|
---|---|
this.c1RangeSlider1.Styles.BarStyle.BorderColor = System.Drawing.Color.MediumBlue; |
Run your project and observe the customizations. Following image shows the changed back color and border color of range bar in C1RangeSlider control:
DisabledBackColor property enables you to set the background color of range bar, which will be visible when the C1RangeSlider control is disabled.
To change the DisabledBackColor in design time complete the following:
To change the DisabledBackColor at run-time, add the following code in FormLoad event:
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Me.C1RangeSlider1.Styles.BarStyle.DisabledBackColor = System.Drawing.SystemColors.ScrollBar |
To write code in C#
C# |
Copy Code
|
---|---|
this.c1RangeSlider1.Styles.BarStyle.DisabledBackColor = System.Drawing.SystemColors.ScrollBar; |
DisabledBorderColor property enables you to set the border color of range bar, which will be visible when the C1RangeSlider control is disabled.
To change the DisabledBorderColor in design time complete the following:
To change the DisabledBorderColor at run-time, add the following code in FormLoad event:
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Me.C1RangeSlider1.Styles.BarStyle.DisabledBorderColor = System.Drawing.Color.Red |
To write code in C#
C# |
Copy Code
|
---|---|
this.c1RangeSlider1.Styles.BarStyle.DisabledBorderColor = System.Drawing.Color.Red; |
Set the Enabled property to False, and run the project. Following image shows disabled back color and disabled border color of range bar in the C1RangeSlider control: