# Getting Started with WinForms DropDownButton

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

## Adding Telerik Assemblies Using NuGet

To use `RadDropDownButton` 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 RadDropDownButton

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

### Design Time

1. To add a **RadDropDownButton** to your form, drag a **RadDropDownButton** from the toolbox onto the surface of the form designer.
2. Like a standard button, you can control the displayed text by setting the **Text** property.
3. Unlike a standard button, **RadDropDownButton** displays drop-down items when clicked. So handling the **Click** event of this button is not appropriate. Instead, work directly with the events for each item.

### Run Time

To programmatically add a **RadDropDownButton** to a form, create a new instance of a **RadDropDownButton**, and add it to the form **Controls** collection.

#### Adding a RadButton at runtime

```C#
RadDropDownButton radDropDownButton = new RadDropDownButton();
radDropDownButton1.Text = "Fruits";
RadMenuItem item1 = new RadMenuItem("Orange");
radDropDownButton1.Items.Add(item1);
RadMenuItem item2 = new RadMenuItem("Lemon");
radDropDownButton1.Items.Add(item2);
RadMenuItem item3 = new RadMenuItem("Banana");
radDropDownButton1.Items.Add(item3);
this.Controls.Add(radDropDownButton);
```

```VB.NET
Dim radDropDownButton As New RadDropDownButton()
radDropDownButton1.Text = "Fruits"
Dim item1 As New RadMenuItem("Orange")
radDropDownButton1.Items.Add(item1)
Dim item2 As New RadMenuItem("Lemon")
radDropDownButton1.Items.Add(item2)
Dim item3 As New RadMenuItem("Banana")
radDropDownButton1.Items.Add(item3)
Me.Controls.Add(radDropDownButton)
```

![WinForms RadButtons buttons-dropdownbutton-overview 001](https://www.telerik.com/products/winforms/documentation/assets/61a837314bdd338ec877674d6ab60da3/buttons-dropdownbutton-overview001.png)

Similarly, you can create item hierarchies in code by adding new **RadMenuItem** objects to the **Items** collection of your existing **RadMenuItem**.

#### Adding sub items

```C#
using Telerik.WinControls.UI;

namespace RadDropDownButtonDemo
{
    public partial class Form1 : Form
    {
        private void Form1_Load(object sender, EventArgs e)
        {
            RadMenuItem mainItem = radDropDownButton1.Items[0] as RadMenuItem;
            RadMenuItem mySubMenuItem = new RadMenuItem();
            mySubMenuItem.Text = "Submenu Item";
            mySubMenuItem.Click += new EventHandler(mySubMenuItem_Click);
            mainItem.Items.Add(mySubMenuItem);
        }
        void mySubMenuItem_Click(object sender, EventArgs e)
        {
            MessageBox.Show((sender as RadMenuItem).Text +
                " was clicked.");
        }
    }
}
```

```VB.NET
Namespace RadDropDownButtonDemo
    Public Class Form1
        Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
            Dim mainItem As RadMenuItem = TryCast(radDropDownButton1.Items(0), RadMenuItem)
            Dim mySubMenuItem As New RadMenuItem()
            mySubMenuItem.Text = "Submenu Item"
            AddHandler mySubMenuItem.Click, AddressOf mySubMenuItem_Click
            mainItem.Items.Add(mySubMenuItem)
        End Sub
        Sub mySubMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs)
            MessageBox.Show((TryCast(sender, RadMenuItem)).Text + " was clicked.")
        End Sub
    End Class
End Namespace

```

### Displaying Images with Items

You can display images and text on your menu items.

![WinForms RadButtons buttons-dropdownbutton-working-with-raddropdownbutton-items 003](https://www.telerik.com/products/winforms/documentation/assets/5f0c5647b4b2721080b0f2190ff47e19/buttons-dropdownbutton-working-with-raddropdownbutton-items003.png)

To add an image to your menu item, click in the **Image** property of the **RadMenuItem**, and then click the ellipsis button to launch the **Select Resource** dialog. From this dialog you can select an image file from a project resource file or from an image resource on your local hard drive. 

![WinForms RadButtons buttons-dropdownbutton-working-with-raddropdownbutton-items 004](https://www.telerik.com/products/winforms/documentation/assets/85344abc075d4a9a4a8d11d6e0791dde/buttons-dropdownbutton-working-with-raddropdownbutton-items004.png)

### Using the Click Event

To handle the **Click** event of individual RadMenuItems on the drop down menu at Design Time, locate the  **RadMenuItem** in the drop down list in the **Properties** window of the Windows Form designer. Click the events button, then double-click the **Click** event to generate an event handler. Then fill in your event-handling code.

## Telerik UI for WinForms Learning Resources

* [Telerik UI for WinForms DropDownButton 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)
