RadControls for WinForms

This tutorial demonstrates connecting a RadTrackBar to a RadTextBox control. Setting the trackbar slider position changes the value in the text box.

  1. Place a RadTrackBar, RadTextBox and RadLabel controls on a form.
  2. Select the RadLabel control and set its Text property to "Current Value:"
  3. Select the RadTextBox control.
  4. Set the value of the Text property to an empty string.
  5. Select the RadTrackBar control.
  6. Set the Maximum property to 30.
  7. Click the Events toolbar button in the Properties window.
  8. Double-click the ValueChanged event.
  9. Replace the automatically-generated event handler with the following code:
    Copy[C#]
    void radTrackBar1_ValueChanged(object sender, EventArgs e)
    {
        this.radTextBox1.Text = radTrackBar1.Value.ToString();
    }
    Copy[VB.NET]
    Private Sub radTrackBar1_ValueChanged(ByVal sender As Object, ByVal e As EventArgs)
        Me.radTextBox1.Text = radTrackBar1.Value.ToString()
    End Sub
  10. Press F5 to run the project.
  11. Move the slider on the trackbar using the mouse. The text box will update to show the new slider position.

    track-and-status-controls-trackbar-overview 001