Getting Started with WinForms TrackBar
This tutorial demonstrates connecting a RadTrackBar to a RadTextBox control. Setting the track bar slider position changes the value in the text box.
Place a RadTrackBar, RadTextBox and RadLabel controls on a form.
Select the RadLabel control and set its Text property to "Current Value:".
Select the RadTrackBar control and set the Maximum property to 30.
Click the Events toolbar button in the Properties window.
Double-click the ValueChanged event.
Replace the automatically-generated event handler with the following code:
void radTrackBar1_ValueChanged(object sender, EventArgs e)
{
this.radTextBox1.Text = radTrackBar1.Value.ToString();
}
Private Sub radTrackBar1_ValueChanged(ByVal sender As Object, ByVal e As EventArgs)
Me.radTextBox1.Text = radTrackBar1.Value.ToString()
End Sub
8. Press F5 to run the project.
9. Move the slider on the track bar using the mouse. The text box will update to show the new slider position.
See Also
Telerik UI for WinForms Learning Resources
- Telerik UI for WinForms TrackBar Component
- Getting Started with Telerik UI for WinForms Components
- Telerik UI for WinForms Setup
- Telerik UI for WinForms Application Modernization
- Telerik UI for WinForms Visual Studio Templates
- Deploy Telerik UI for WinForms Applications
- Telerik UI for WinForms Virtual Classroom(Training Courses for Registered Users)
- Telerik UI for WinForms License Agreement)