RadControls for WinForms

This tutorial illustrates how to start and stop the animation of RadWaitingBar.

  1. Place a RadWaitingBar control and a RadButton control on a form.

  2. Select the RadWaitingBar control.

  3. In the Properties window set the WaitingDirection property to Bottom.

  4. Resize the RadWaitingBar so that its height is larger than its width.

  5. Select the RadButton control.

  6. Set the Text property to Start.

  7. In the Properties window click the events button.

  8. Double-click the Click event.

  9. Replace the automatically-generated event handler with this code:

    Copy[C#]
    private void radButton1_Click(object sender, EventArgs e)
    {
        if (radWaitingBar1.IsWaiting)
        {
            radWaitingBar1.StopWaiting();
            this.radButton1.Text = "Start";
        }
        else
        {
            radWaitingBar1.StartWaiting();
            this.radButton1.Text = "Stop";
        }
    }
    Copy[VB.NET]
    Private Sub radButton1_Click(ByVal sender As Object, ByVal e As EventArgs)
        If RadWaitingBar1.IsWaiting Then
            RadWaitingBar1.StopWaiting()
            Me.RadButton1.Text = "Start"
        Else
            RadWaitingBar1.StartWaiting()
            Me.RadButton1.Text = "Stop"
        End If
    End Sub

  10. Press F5 to run the project.

  11. Click the Start button to start and stop the animation.

    track-and-status-controls-waitingbar-getting-started 001