Input for WinForms | ComponentOne
Input Controls / RangeSlider
In This Topic
    RangeSlider
    In This Topic

    C1RangeSlider is a simple control that enables you to select a range of numeric data with lower value thumb and upper value thumb. These thumbs define start and end values of the range. When you drag the thumb towards the left (or down) on Range Bar you reduce its value, and you increase the value when drag it towards the right (or up). The control has minimum and maximum bounds for thumb values. Thumb value cannot be less than the minimum bound and more than the maximum bound. Moreover, lower value cannot be greater than the upper value, and otherwise. The control can be oriented horizontally or vertically.

    An image of rangeslider control with two left and right bars.

    RangeSlider Elements

    When you add C1Range Slider control to your form it exists as a completely functional slider control, with two thumbs to set range values and a range bar on which the thumbs move.

    The Maximum and Minimum properties in C1RangeSlider class enable you to set upper and lower allowable bounds for range in C1RangeSlider control. Lower value thumb cannot be set to a value less than the Minimum, and Upper Value thumb cannot be set to a value greater than the Maximum. By default Minimum is set to 0 and Maximum is set to 100. Set the Minimum and Maximum values using Minimum and Maximum properties from Properties pane of the control, or through code.

    C1RangeSlider control can be displayed Horizontally or Vertically, using Orientation property. By default, the control is oriented horizontally. rangeslider You can easily change the orientation through Orientation property in Properties pane, or through code.

    The UpperValue property gets or sets the current upper magnitude of the range control, while the LowerValue property gets or sets the current lower magnitude of the range control. Range in C1RangeSlider control is the difference between UpperValue and LowerValue properties. These two values are linked with movable thumbs which are used to set the numeric range on the control.

    C#
    Copy Code
    // Configuring Range Slider
    c1RangeSlider1.LargeChange = 5D;
    c1RangeSlider1.Location = new Point(388, 40);
    c1RangeSlider1.LowerValue = 0D;
    c1RangeSlider1.Maximum = 100D;
    c1RangeSlider1.Minimum = 0D;
    c1RangeSlider1.Name = "c1RangeSlider1";
    c1RangeSlider1.Size = new Size(121, 27);
    c1RangeSlider1.TabIndex = 7;
    c1RangeSlider1.Text = "c1RangeSlider1";
    c1RangeSlider1.UpperValue = 100D;
    

    The LargeChange property gets or sets the value to be added to or subtracted from the LowerValue or UpperValue properties when the lower value thumb or upper value thumb is moved a large distance.