# Getting Started with WinForms Button

This article shows how you can start using `RadButton`.

## Adding Telerik Assemblies Using NuGet

To use `RadButton` when working with NuGet packages, install the `Telerik.UI.for.WinForms.AllControls` package. The [package target framework version may vary](https://www.telerik.com/products/winforms/documentation/visual-studio-integration/available-nugets).

Read more about NuGet installation in the [Install using NuGet Packages](https://www.telerik.com/products/winforms/documentation/installation-and-upgrades/install-using-nuget) article.

> tip With the 2025 Q1 release, the Telerik UI for WinForms has a new licensing mechanism. You can learn more about it [here](https://www.telerik.com/products/winforms/documentation/licensing/license-key).

## Adding Assembly References Manually

When dragging and dropping a control from the Visual Studio (VS) Toolbox onto the Form Designer, VS automatically adds the necessary assemblies. However, if you're adding the control programmatically, you'll need to manually reference the following assemblies:

* **Telerik.Licensing.Runtime**
* **Telerik.WinControls**
* **Telerik.WinControls.UI**
* **TelerikCommon**

The Telerik UI for WinForms assemblies can be installed by using one of the available [installation approaches](https://www.telerik.com/products/winforms/documentation/installation-and-upgrades/installing-on-your-computer).

## Defining the **RadButton**

You can add **RadButton** either at design time or at run time:

### Design Time

1. To add a **RadButton** to your form, drag a **RadButton** from the toolbox onto the surface of the form designer.
2. In the *Properties* section in Visual Studio change the **Text** property of **RadButton**.
3. Double click the button to generate the **Click** event handler. Add the desired code to perform the required action.
4. Click `F5` to start the application.

### Run Time

To programmatically add a **RadButton** to a form, create a new instance of a **RadButton**, and add it to the form **Controls** collection. Subscribe to its **Click** event in order to perform the required action, e.g. showing a message box:

#### Adding a RadButton at runtime

```C#
RadButton myNewRadButton = new RadButton();
myNewRadButton.Text = "My New RadButton";
myNewRadButton.Width = 150;
myNewRadButton.Height = 50;
this.Controls.Add(myNewRadButton);
myNewRadButton.Click+=myNewRadButton_Click;
```

```VB.NET
Dim myNewRadButton As New RadButton()
myNewRadButton.Text = "My New RadButton"
myNewRadButton.Width = 150
myNewRadButton.Height = 50
Me.Controls.Add(myNewRadButton)
AddHandler myNewRadButton.Click, AddressOf myNewRadButton_Click
```

```C#
private void myNewRadButton_Click(object sender, EventArgs e)
{
    RadMessageBox.Show("Clicked");
}
```

```VB.NET
Private Sub myNewRadButton_Click(sender As Object, e As EventArgs)
    RadMessageBox.Show("Clicked")
End Sub
```

## Telerik UI for WinForms Learning Resources

* [Telerik UI for WinForms Button Component](https://www.telerik.com/products/winforms/buttons.aspx)
* [Getting Started with Telerik UI for WinForms Components](https://docs.telerik.com/devtools/winforms/getting-started/first-steps)
* [Telerik UI for WinForms Setup](https://docs.telerik.com/devtools/winforms/installation-and-upgrades/installing-on-your-computer)
* [Telerik UI for WinForms Converter](https://www.telerik.com/products/winforms/documentation/ai-coding-assistant/converter/converter)
* [Telerik UI for WinForms Visual Studio Templates](https://docs.telerik.com/devtools/winforms/visual-studio-integration/visual-studio-templates)
* [Deploy Telerik UI for WinForms Applications](https://docs.telerik.com/devtools/winforms/deployment-and-distribution/application-deployment)
* [Telerik UI for WinForms Virtual Classroom(Training Courses for Registered Users)](https://learn.telerik.com/learn/course/external/view/elearning/17/telerik-ui-for-winforms)
* [Telerik UI for WinForms License Agreement)](https://www.telerik.com/purchase/license-agreement/winforms-dlw-s)
