ComponentOne Slider for ASP.NET AJAX: Slider for ASP.NET AJAX Top Tips

Slider for ASP.NET AJAX Top Tips

The following tips were compiled from frequently asked user questions posted in the ComponentOne Studio for ASP.NET AJAX's online forum.

Tip 1: Display two Thumb buttons

A second thumb button can be added to the C1Slider control by setting both ShowThumbButton2 and ShowThumbButton properties to True. Even if the ShowThumbButton2 property is set to True, the two thumb buttons will not be shown if the ShowThumbButton property is set to False.

The following code sets the ShowThumbButton2 property to show the second thumb button:

      Visual Basic

Me.C1Slider1.ShowThumbButton = True

Me.C1Slider1.ShowThumbButton2 = True

      C#

this.C1Slider1.ShowThumbButton = true;

this.C1Slider1.ShowThumbButton2 = true;

Note that the two thumb buttons will not be shown though ShowThumbButton2 property is set to True if the ShowThumbButton property is set to False.

Tip 2: Customize Thumb button interaction

The ThumbsInteractionMode property can be used to customize the way that the two C1Slider thumb buttons interact . You can set the ThumbsInteractionMode property to Free, Locked, or Push.

The following table describes each of the ThumbsInteractionMode options:

 

Member Name

Description

Free

Thumbs are free to slide past each other.

Locked

Thumbs cannot slide past or push each other.

Push

Thumbs will push each other when they slide next to one another.

The following code sets the ThumbsInteractionMode property to show that thumbs cannot slide past or push each other:

      Visual Basic

Me.C1Slider1.ThumbsInteractionMode = C1.Web.UI.Controls.C1Slider.SliderThumbsInteractionMode.Push

      C#

this.C1Slider1.ThumbsInteractionMode = C1.Web.UI.Controls.C1Slider.SliderThumbsInteractionMode.Push;

Tip 3: Reverse the Increment and Decrement buttons

The Reverse property can be used to reverse Increment/Decrement buttons. When the Increment and Decrement buttons are reversed, the Increment button will decrease the Value and the Decrement button will increase the Value. For example:

      Visual Basic

Me.C1Slider1.Reverse = True

      C#

this.C1Slider1.Reverse = true;

Tip 4: Customize the appearance of the selected region on the track

You can set the TrackFill property to determine how the selected region on the slider track will be displayed. You can set the TrackFill property to None, MainValue, Range, or All. The following table describes each of the TrackFillMode options:

 

Member Name

Description

None

Values on the slider track bar are not displayed.

MainValue

Shows extra style with ValueFill in track bar for area between edge and main Value only.

Range

Shows extra style with ValueFill in track bar for area between Value and SecondaryValue.

All

Shows extra styles in track bar for both Value and SecondaryValue.

 

The following code sets the TrackFill property to show the selection region with ValueFill in the track bar for the area between Value and Value2:

      Visual Basic

Me.C1Slider1.TrackFill = C1.Web.UI.Controls.C1Slider.TrackFillMode.Range

      C#

this.C1Slider1.TrackFill = C1.Web.UI.Controls.C1Slider.TrackFillMode.Range;


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.