RangeSliderControl

March 15, 2026 · View on GitHub

A dual-thumb range slider that allows users to select a range of values by dragging two thumbs along a track. Supports minimum range enforcement, keyboard thumb switching, and both horizontal and vertical orientations.

Properties

PropertyTypeDefaultDescription
LowValuedouble0Low end of the selected range
HighValuedouble100High end of the selected range
MinValuedouble0Minimum value of the full range
MaxValuedouble100Maximum value of the full range
Stepdouble1Step increment for arrow keys
LargeStepdouble10Large step for Page Up/Down and Shift+Arrow
MinRangedouble0Minimum required gap between low and high values
ActiveThumbActiveThumbLowWhich thumb receives keyboard input
OrientationSliderOrientationHorizontalSlider orientation
ShowValueLabelboolfalseShow range value label
ShowMinMaxLabelsboolfalseShow min/max labels at track ends
ValueLabelFormatstring"F0"Format string for value labels

Events

EventTypeDescription
LowValueChangedEventHandler<double>Fires when the low value changes
HighValueChangedEventHandler<double>Fires when the high value changes
RangeChangedEventHandler<(double Low, double High)>Fires when either value changes
GotFocusEventHandlerFires when the slider receives focus
LostFocusEventHandlerFires when the slider loses focus

Creating with Builder

// Basic range slider
var range = Controls.RangeSlider()
    .WithValues(25, 75)
    .ShowValueLabel()
    .Build();

// Price range with constraints
var price = Controls.RangeSlider()
    .WithRange(0, 1000)
    .WithValues(200, 800)
    .WithStep(10)
    .WithMinRange(50)
    .ShowMinMaxLabels()
    .OnRangeChanged((s, r) => label.SetLines($"${r.Low} - ${r.High}"))
    .Build();

Keyboard Shortcuts

KeyAction
TabSwitch active thumb (Low/High)
Right/Up ArrowMove active thumb by Step
Left/Down ArrowMove active thumb by -Step
Shift+ArrowMove by LargeStep
Page Up/DownMove by LargeStep
HomeMove active thumb to its minimum bound
EndMove active thumb to its maximum bound

Mouse Interaction

  • Click near thumb: Select and start dragging that thumb
  • Click between thumbs: Jump nearest thumb to position
  • Overlapping thumbs: High thumb takes priority
  • Drag: Move active thumb, respecting MinRange

Visual Layout

[0] │──────●━━━━━━●──────│ [100]  25-75
    ^cap   ^low   ^hi    ^cap      ^label