)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to load custom controls in the ToolStripDropDownButton DropDown?

Platform: WinForms |
Control: RibbonControlAdv |
Published Date: December 10, 2014 |
Last Revised Date: February 4, 2020

Load custom controls

You can load custom control as dropdown of the ToolStripDropDownButton by using the DropDown property in the ToolStripDropDownButton. This property helps you to assign the custom dropdown to dropdown of the ToolStripDropDownButton.

C#

//Assigns the custom DropDown to the ToolStripDropDownbutton
this.toolStripDropDownButton1.DropDown = new CustomDropDown(this.menuStrip1);
//Creates the CustomDropDown class
public class CustomDropDown : ToolStripDropDown
{
    public CustomDropDown(MenuStrip menuStrip)
    {
        this.Items.Add(new ToolStripControlHost(menuStrip));
    }
}

VB

'Assigns the custom DropDown to the ToolStripDropDownbutton
Me.toolStripDropDownButton1.DropDown = New CustomDropDown(Me.menuStrip1)
'Creates the CustomDropDown class
Public Class CustomDropDown
     Inherits ToolStripDropDown
     Public Sub New(ByVal menuStrip As MenuStrip)
         Me.Items.Add(New ToolStripControlHost(menuStrip))
     End Sub
End Class

 

Custom Dropdown loaded in the ToolStripDropDown button

Figure 1: Custom DropDown loaded in the ToolStripDropDown button.

Samples:

C#: CustomDropDown_C#

VB: CustomDropDown_VB

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon