# Modes

**RadTrackBar** supports three different modes - *SingleThumb*, *StartFromTheBeginning* and *Range*. Each of these modes defines its own functionality and behavior. You can change the mode of the control via its **TrackBarMode** property.

## SingleThumb

In this mode **RadTrackBar** works like a standard **TrackBar**. It contains one thumb and its value can be accessed through the **Value** property of **RadTrackBar**. To receive notification when value is changed you can use the **ValueChanged** event.

> caption Figure 1: SingleThumb

![WinForms RadTrackBar SingleThumb](https://www.telerik.com/products/winforms/documentation/assets/b1800ceacc8ec6b939a124f40b7c245d/track-and-status-controls-trackbar-modes001.png)

## StartFromTheBeginning

In this mode **RadTrackBar** looks like **RadTrackBar** in *SingleThumb* mode, but it can contain more than one thumb. To show more than one thumb you should add the desired ranges (**TrackBarRange**) in the **Ranges** collection of control. For example:

```C#
this.radTrackBar1.TrackBarMode = Telerik.WinControls.UI.TrackBarRangeMode.StartFromTheBeginning;
this.radTrackBar1.Ranges.Add(new TrackBarRange(0, 5, "MyRange1"));
this.radTrackBar1.Ranges.Add(new TrackBarRange(0, 15, "MyRange2"));
```

```VB.NET
Me.RadTrackBar1.TrackBarMode = Telerik.WinControls.UI.TrackBarRangeMode.StartFromTheBeginning
Me.RadTrackBar1.Ranges.Add(New TrackBarRange(0, 5, "MyRange1"))
Me.RadTrackBar1.Ranges.Add(New TrackBarRange(0, 15, "MyRange2"))
```

![WinForms RadTrackBar StartFromTheBeginning](https://www.telerik.com/products/winforms/documentation/assets/a49607f60e9e6825f1ae34c103ee60e3/track-and-status-controls-trackbar-modes002.png)

In order to access the values of the thumbs in this mode you should go through the **Ranges** collection and check the values of each **TrackBarRange**. Please, note that even though **TrackBarRange** has both **Start** and **End** properties, in this mode **RadTrackBar** uses only the **End** property, so you should access it in order to take the value of some range.

```C#
float fitstRangeValue = this.radTrackBar1.Ranges[0].End;
float secondRangeValue = this.radTrackBar1.Ranges[1].End;
```

```VB.NET
Dim fitstRangeValue As Single = Me.RadTrackBar1.Ranges(0).[End]
Dim secondRangeValue As Single = Me.RadTrackBar1.Ranges(1).[End]
```

To receive notification when the **Value** is changed in this mode, you should use the **RangeValueChanged** event of the **RadTrackBar**:

```C#
private void RadTrackBar1_RangeValueChanged(object sender, RangeChangedEventArgs e)
{
    Console.WriteLine("Radge {0} Start {1}, End {2}", e.ChangedRange.Text, e.ChangedRange.Start, e.ChangedRange.End);
}
```

```VB.NET
    Private Sub RadTrackBar1_RangeValueChanged(ByVal sender As Object, ByVal e As RangeChangedEventArgs)
        Console.WriteLine("Radge {0} Start {1}, End {2}", e.ChangedRange.Text, e.ChangedRange.Start, e.ChangedRange.End)
    End Sub

```

## Range

This mode allows you to define one or more **Ranges** with **Start** and **End** values.  In this mode there the **Ranges** cannot to overlap each other. To display a second range, you should add the desired **Range (TrackBarRange)** in the **Ranges** collection of the control. For example:

```C#
this.radTrackBar1.TrackBarMode = Telerik.WinControls.UI.TrackBarRangeMode.Range;
this.radTrackBar1.Ranges[0].Start = 2;
this.radTrackBar1.Ranges[0].End = 5;
this.radTrackBar1.Ranges.Add(new TrackBarRange(10, 15));
```

```VB.NET
Me.RadTrackBar1.TrackBarMode = Telerik.WinControls.UI.TrackBarRangeMode.Range
Me.RadTrackBar1.Ranges(0).Start = 2
Me.RadTrackBar1.Ranges(0).[End] = 5
Me.RadTrackBar1.Ranges.Add(New TrackBarRange(10, 15))
```

![WinForms RadTrackBar Range](https://www.telerik.com/products/winforms/documentation/assets/658242741521820755ed741f53eda10b/track-and-status-controls-trackbar-modes003.png)

To receive notification when the **Value** is changed in this mode, you should use the **RangeValueChanged** event of the RadTrackBar:

```C#
private void RadTrackBar1_RangeValueChanged(object sender, RangeChangedEventArgs e)
{
    Console.WriteLine("Radge {0} Start {1}, End {2}", e.ChangedRange.Text, e.ChangedRange.Start, e.ChangedRange.End);
}
```

```VB.NET
    Private Sub RadTrackBar1_RangeValueChanged(ByVal sender As Object, ByVal e As RangeChangedEventArgs)
        Console.WriteLine("Radge {0} Start {1}, End {2}", e.ChangedRange.Text, e.ChangedRange.Start, e.ChangedRange.End)
    End Sub

```

> important The **Ranges** collection of **RadTrackBar** contains one default range that is used to display a default range for all modes. This collection should always contain at least one range, so if you execute the *Clear* method of the collection all ranges except the first one will be removed.

> note When the mode is changed from **StartFromTheBeginning** to something else, the **Ranges** collection will be reset to prevent overlappings that are not allowed in the other modes.

## See Also

* [Structure](https://www.telerik.com/products/winforms/documentation/controls/track-and-status-controls/trackbar/control-element-structure)
* [Design Time](https://www.telerik.com/products/winforms/documentation/controls/track-and-status-controls/trackbar/design-time)
* [Getting Started](https://www.telerik.com/products/winforms/documentation/controls/track-and-status-controls/trackbar/getting-started)
* [Properties and Events](https://www.telerik.com/products/winforms/documentation/controls/track-and-status-controls/trackbar/properties-events)
