menu

WinForms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class RangeSlider - WindowsForms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class RangeSlider

    Represents a slider control that allows users select a range of values within the specified minimum and maximum limits by moving thumbs along a track.

    Inheritance
    System.Object
    BaseControl
    RangeSlider
    Implements
    IThemeProvider
    IVisualStyle
    System.IDisposable
    Inherited Members
    BaseControl.CanApplyTheme
    BaseControl.CanOverrideStyle
    BaseControl.ControlName
    BaseControl.GetActiveThemeName()
    BaseControl.IsVisualStyleEnabled
    BaseControl.IThemeProvider.BaseThemeName
    BaseControl.IVisualStyle.VisualTheme
    BaseControl.RaiseThemeChanged(Object, ThemeChangedEventArgs)
    BaseControl.ThemeName
    BaseControl.ThemeNameChanged
    Namespace: Syncfusion.Windows.Forms.Tools
    Assembly: Syncfusion.Tools.Windows.dll
    Syntax
    public class RangeSlider : BaseControl, IThemeProvider, IVisualStyle, IDisposable

    Constructors

    RangeSlider()

    Initializes a new instance of the RangeSlider class.

    Declaration
    public RangeSlider()

    RangeSlider(Int32, Int32)

    Initializes a new instance of RangeSlider with the specified minimum and maximum values.

    Declaration
    public RangeSlider(int min, int max)
    Parameters
    Type Name Description
    System.Int32 min

    Minimum value.

    System.Int32 max

    Maximum value.

    Fields

    prev_channelColor

    Previous channel color.

    Declaration
    protected Color prev_channelColor
    Field Value
    Type
    System.Drawing.Color

    prev_rangeColor

    Previous range color.

    Declaration
    protected Color prev_rangeColor
    Field Value
    Type
    System.Drawing.Color

    prev_thumbColor

    Previous thumb color.

    Declaration
    protected Color prev_thumbColor
    Field Value
    Type
    System.Drawing.Color

    Properties

    AutoSize

    Gets or sets a value that indicates whether the height or width of the RangeSlider is being automatically sized.

    Declaration
    public override bool AutoSize { get; set; }
    Property Value
    Type
    System.Boolean

    BackColor

    Gets the background color for the RangeSlider. (overridden property)

    Declaration
    public override Color BackColor { get; }
    Property Value
    Type
    System.Drawing.Color

    BeforeTouchSize

    Gets or sets the size of the control before touch is enabled.

    Declaration
    public Size BeforeTouchSize { get; set; }
    Property Value
    Type
    System.Drawing.Size

    ChannelBounds

    Gets the channel bounds.

    Declaration
    protected virtual Rectangle ChannelBounds { get; }
    Property Value
    Type Description
    System.Drawing.Rectangle

    The channel bounds.

    ChannelColor

    Gets or sets the color used to fill the channel line of RangeSlider.

    Declaration
    public Color ChannelColor { get; set; }
    Property Value
    Type Description
    System.Drawing.Color

    The color of the channel.

    ChannelHeight

    Gets or sets a value that represents the height of the channel line.

    Declaration
    public int ChannelHeight { get; set; }
    Property Value
    Type Description
    System.Int32

    The height of the channel.

    CurrentArea

    Gets or sets the current area where Mouse pointer is.

    Declaration
    protected RangeSlider.RangeSliderArea CurrentArea { get; set; }
    Property Value
    Type Description
    RangeSlider.RangeSliderArea

    The curent area.

    EnableTouchMode

    Gets or sets a value to enable or disable the touch mode to the RangeSlider control.

    Declaration
    public bool EnableTouchMode { get; set; }
    Property Value
    Type
    System.Boolean
    Remarks

    Scale factor will be updated automatically if scalefactor is equal to 1

    FocussedThumb

    Gets a value that indicates whether the left or right thumb has focus in RangeSlider.

    Declaration
    public RangeSlider.Thumb FocussedThumb { get; set; }
    Property Value
    Type
    RangeSlider.Thumb

    Font

    Overrides the font property.

    Declaration
    public override Font Font { get; set; }
    Property Value
    Type
    System.Drawing.Font

    HighlightedThumbColor

    Gets or sets the color used to draw the thumb in then RangeSlider control when mouse hover the thumb.

    Declaration
    public Color HighlightedThumbColor { get; set; }
    Property Value
    Type Description
    System.Drawing.Color

    The color of the highlighted thumb.

    InnerChannel

    Gets the inner channel.

    Declaration
    protected virtual Rectangle InnerChannel { get; }
    Property Value
    Type Description
    System.Drawing.Rectangle

    The inner channel.

    LabelOrientation

    Gets or sets a value that determines orientation of the labels present in the RangeSlider control.

    Declaration
    public Orientation LabelOrientation { get; set; }
    Property Value
    Type
    System.Windows.Forms.Orientation

    LabelPlacement

    Gets or sets a value that determines the placement of the labels present in the RangeSlider control.

    Declaration
    public LabelPlacement LabelPlacement { get; set; }
    Property Value
    Type
    LabelPlacement

    LeftOuterChannel

    Gets the left outer channel.

    Declaration
    protected virtual Rectangle LeftOuterChannel { get; }
    Property Value
    Type Description
    System.Drawing.Rectangle

    The left outer channel.

    LeftSliderBounds

    Gets the left slider bounds.

    Declaration
    protected virtual Rectangle LeftSliderBounds { get; }
    Property Value
    Type Description
    System.Drawing.Rectangle

    The left slider bounds.

    LeftSliderPosition

    Gets or sets the left slider position.

    Declaration
    protected int LeftSliderPosition { get; set; }
    Property Value
    Type Description
    System.Int32

    The left slider position.

    Maximum

    Gets or sets a value that indicates the maximum value constraint for ranges in RangeSlider. This restricts to set the upper end of range greater than specified value.

    Declaration
    public int Maximum { get; set; }
    Property Value
    Type
    System.Int32

    Minimum

    Gets or sets a value that indicates the minimum value constraint for ranges in RangeSlider. This restricts to set the lower end of range lesser than specified value.

    Declaration
    public int Minimum { get; set; }
    Property Value
    Type
    System.Int32

    Orientation

    Gets or sets a value that indicates the horizontal or vertical orientation of the RangeSlider.

    Declaration
    public Orientation Orientation { get; set; }
    Property Value
    Type Description
    System.Windows.Forms.Orientation

    The orientation.

    PushedItem

    Gets or sets the currently pushed item.

    Declaration
    protected RangeSlider.RangeSliderArea PushedItem { get; set; }
    Property Value
    Type Description
    RangeSlider.RangeSliderArea

    The pushed item.

    PushedThumbColor

    Gets or sets the color used to draw the thumb in the RangeSlider control when clicking it to track the slider.

    Declaration
    public Color PushedThumbColor { get; set; }
    Property Value
    Type Description
    System.Drawing.Color

    The color of the pushed thumb.

    Range

    Gets a value that represents difference between upper and lower ends of selected range in the RangeSlider control.

    Declaration
    public int Range { get; }
    Property Value
    Type
    System.Int32

    RangeColor

    Gets or sets the color used to fill the selected range in the channel line of RangeSlider.

    Declaration
    public Color RangeColor { get; set; }
    Property Value
    Type Description
    System.Drawing.Color

    The color of the range.

    RightOuterChannel

    Gets the right outer channel.

    Declaration
    protected virtual Rectangle RightOuterChannel { get; }
    Property Value
    Type Description
    System.Drawing.Rectangle

    The right outer channel.

    RightSliderBounds

    Gets the right slider bounds.

    Declaration
    protected virtual Rectangle RightSliderBounds { get; }
    Property Value
    Type Description
    System.Drawing.Rectangle

    The right slider bounds.

    RightSliderPosition

    Gets or sets the right slider position.

    Declaration
    protected int RightSliderPosition { get; set; }
    Property Value
    Type Description
    System.Int32

    The right slider position.

    ShowLabels

    Gets or sets a value that indicates the visibility of the labels present in RangeSlider.

    Declaration
    public bool ShowLabels { get; set; }
    Property Value
    Type
    System.Boolean

    ShowThumbFocused

    Gets or sets a value that indicates whether the focused thumb should display highlight rectangle in thumb.

    Declaration
    public bool ShowThumbFocused { get; set; }
    Property Value
    Type
    System.Boolean

    ShowTicks

    Gets or sets a value that indicates whether to show or hide the tick marks in RangeSlider.

    Declaration
    public bool ShowTicks { get; set; }
    Property Value
    Type
    System.Boolean

    SliderMax

    Gets or sets the end value of the range in the RangeSlider control.

    Declaration
    public int SliderMax { get; set; }
    Property Value
    Type Description
    System.Int32

    Maximum Slider value.

    SliderMin

    Gets or sets the start value of the range in the RangeSlider control.

    Declaration
    public int SliderMin { get; set; }
    Property Value
    Type Description
    System.Int32

    Minimum Slider value.

    SliderSize

    Gets or sets the size of the thumbs present in the RangeSlider control.

    Declaration
    public Size SliderSize { get; set; }
    Property Value
    Type Description
    System.Drawing.Size

    The size of the slider.

    ThemeStyle

    Gets or sets the value used to customize the appearance of the RangeSlider.

    Declaration
    public RangeSliderVisualStyle ThemeStyle { get; set; }
    Property Value
    Type
    RangeSliderVisualStyle

    ThumbBorderColor

    Gets the color of the thumb border.

    Declaration
    protected virtual Color ThumbBorderColor { get; }
    Property Value
    Type Description
    System.Drawing.Color

    The color of the thumb border.

    ThumbColor

    Gets or sets the color used to draw the thumb in the RangeSlider control.

    Declaration
    public Color ThumbColor { get; set; }
    Property Value
    Type
    System.Drawing.Color

    ThumbStartColor

    Gets the start color of the thumb.

    Declaration
    protected virtual Color ThumbStartColor { get; }
    Property Value
    Type Description
    System.Drawing.Color

    The start color of the thumb.

    TickColor

    Gets or sets the color used to draw ticks in the RangeSlider control.

    Declaration
    public Color TickColor { get; set; }
    Property Value
    Type
    System.Drawing.Color

    TickFrequency

    Gets or sets a value that specifies the delta between ticks drawn in the RangeSlider control.

    Declaration
    public int TickFrequency { get; set; }
    Property Value
    Type
    System.Int32

    TickPlacement

    Gets or sets a value that determines the placement of tick in the RangeSlider control.

    Declaration
    public TickPlacement TickPlacement { get; set; }
    Property Value
    Type
    TickPlacement

    VisualStyle

    Gets or sets the visual style, which determines the appearance of the RangeSlider control.

    Declaration
    public RangeSlider.RangeSliderStyle VisualStyle { get; set; }
    Property Value
    Type
    RangeSlider.RangeSliderStyle

    Methods

    ApplyScaleToControl(Single)

    Scales the size of the control based on the scale factor passed in the argument.

    Declaration
    public void ApplyScaleToControl(float scaleFactor)
    Parameters
    Type Name Description
    System.Single scaleFactor

    Float value, in which the control to be scaled.

    CreateAccessibilityInstance()

    Creates a new accessibility object in RangeSlider.

    Declaration
    protected override AccessibleObject CreateAccessibilityInstance()
    Returns
    Type Description
    System.Windows.Forms.AccessibleObject

    Returns a new System.Windows.Forms.AccessibleObject for the RangeSlider

    Dispose(Boolean)

    Clean up any resources being used.

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing

    true if managed resources should be disposed; otherwise, false.

    DrawMetroSliders(Rectangle, Graphics, Boolean, Boolean)

    Draw the metro slider.

    Declaration
    protected void DrawMetroSliders(Rectangle rect, Graphics graphics, bool focus, bool leftThumb)
    Parameters
    Type Name Description
    System.Drawing.Rectangle rect

    Rectangle.

    System.Drawing.Graphics graphics

    The graphics.

    System.Boolean focus
    System.Boolean leftThumb

    DrawSlider(Graphics)

    Draws the sliders.

    Declaration
    protected void DrawSlider(Graphics graphics)
    Parameters
    Type Name Description
    System.Drawing.Graphics graphics

    The graphics.

    GetControlName(String)

    Helps to apply the ControlName settings in control

    Declaration
    public override string GetControlName(string controlName)
    Parameters
    Type Name Description
    System.String controlName
    Returns
    Type
    System.String
    Overrides
    BaseControl.GetControlName(String)

    MoveThumb(RangeSlider.Thumb, Int32)

    Moves the left or right thumb to defined value.

    Declaration
    public void MoveThumb(RangeSlider.Thumb thumb, int pos)
    Parameters
    Type Name Description
    RangeSlider.Thumb thumb

    Thumb that has to be moved. Mentions the left or right thumb.

    System.Int32 pos

    Value to mention how far the thumb should be moved.

    OnCanApplyThemeChanged(Boolean)

    Helps to apply the CanApplyTheme settings in control

    Declaration
    public override void OnCanApplyThemeChanged(bool canApplyTheme)
    Parameters
    Type Name Description
    System.Boolean canApplyTheme
    Overrides
    BaseControl.OnCanApplyThemeChanged(Boolean)

    OnCanOverrideStyleChanged(Boolean)

    Helps to apply the CanOverriderStyle settings in control

    Declaration
    public override void OnCanOverrideStyleChanged(bool canOverriderStyle)
    Parameters
    Type Name Description
    System.Boolean canOverriderStyle
    Overrides
    BaseControl.OnCanOverrideStyleChanged(Boolean)

    OnFontChanged(EventArgs)

    Font changed

    Declaration
    protected override void OnFontChanged(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    OnMouseCaptureChanged(EventArgs)

    Handles When Mouse is released

    Declaration
    protected override void OnMouseCaptureChanged(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    An EventArgs that contains the event data.

    OnMouseDown(MouseEventArgs)

    Processes Mouse Click

    Declaration
    protected override void OnMouseDown(MouseEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Forms.MouseEventArgs e

    A MouseEventArgs that contains the event data.

    OnMouseLeave(EventArgs)

    Resets current Area

    Declaration
    protected override void OnMouseLeave(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    An System.EventArgs that contains the event data.

    OnMouseMove(MouseEventArgs)

    Handles Mouse Moving

    Declaration
    protected override void OnMouseMove(MouseEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Forms.MouseEventArgs e

    A MouseEventArgs that contains the event data.

    OnPaint(PaintEventArgs)

    Paints the RangeSlider

    Declaration
    protected override void OnPaint(PaintEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Forms.PaintEventArgs e

    A PaintEventArgs that contains the event data.

    OnSizeChanged(EventArgs)

    Declaration
    protected override void OnSizeChanged(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    OnThemeNameChanged(String)

    Helps to apply the ThemeName settings in control

    Declaration
    public override void OnThemeNameChanged(string themeName)
    Parameters
    Type Name Description
    System.String themeName

    ThemeName

    Overrides
    BaseControl.OnThemeNameChanged(String)

    ResetChannelColor()

    Resets the ChannelColor to its default value

    Declaration
    public void ResetChannelColor()

    ResetHighlightedThumbColor()

    Declaration
    protected void ResetHighlightedThumbColor()

    ResetPushedThumbColor()

    Declaration
    protected void ResetPushedThumbColor()

    ResetRangeColor()

    Resets the RangeColor to its default value.

    Declaration
    public void ResetRangeColor()

    ResetThumbColor()

    Resets the ThumbColor to its default value

    Declaration
    public void ResetThumbColor()

    ResetTickColor()

    Declaration
    protected void ResetTickColor()

    SetBoundsCore(Int32, Int32, Int32, Int32, BoundsSpecified)

    Sets height on AutoSize.

    Declaration
    protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified)
    Parameters
    Type Name Description
    System.Int32 x

    X position

    System.Int32 y

    Y Position

    System.Int32 width

    Bounds Width

    System.Int32 height

    Bounds Height

    System.Windows.Forms.BoundsSpecified specified

    Bounds Speified

    ShouldSerializeChannelColor()

    Serializes channel color.

    Declaration
    protected bool ShouldSerializeChannelColor()
    Returns
    Type
    System.Boolean

    ShouldSerializeHighlightedThumbColor()

    Declaration
    protected bool ShouldSerializeHighlightedThumbColor()
    Returns
    Type
    System.Boolean

    ShouldSerializePushedThumbColor()

    Declaration
    protected bool ShouldSerializePushedThumbColor()
    Returns
    Type
    System.Boolean

    ShouldSerializeRangeColor()

    Serializes range color.

    Declaration
    protected bool ShouldSerializeRangeColor()
    Returns
    Type
    System.Boolean

    ShouldSerializeThumbColor()

    Serializes thumb color.

    Declaration
    protected bool ShouldSerializeThumbColor()
    Returns
    Type
    System.Boolean

    ShouldSerializeTickColor()

    Declaration
    protected bool ShouldSerializeTickColor()
    Returns
    Type
    System.Boolean

    Events

    DrawLabel

    Occurs when drawing custom labels in RangeSlider.

    Declaration
    public event EventHandler<DrawLabelEventArgs> DrawLabel
    Event Type
    Type
    System.EventHandler<DrawLabelEventArgs>

    Scroll

    Occurs when the thumb is moved using mouse action.

    Declaration
    public event EventHandler Scroll
    Event Type
    Type
    System.EventHandler

    ValueChanged

    Occurs when the Value property of RangeSlider changes by either movement of the thumb or manipulation in code

    Declaration
    public event EventHandler ValueChanged
    Event Type
    Type
    System.EventHandler

    Implements

    IThemeProvider
    IVisualStyle
    System.IDisposable
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved