The WinForms DropDownButton control is a push button with an associated popup control. This example demonstrates how to display a popup menu when the drop-down button is clicked. The example demonstrates how to customize the DropDownButton
at design-time and runtime.
Use the DropDownButton.DropDownControl property to assign a PopupMenu to a DropDownButton control.
private void InitDropDownButton() {
// Creates the DropDownButton.
DropDownButton dropDownButton = CreateDropDownButton("Button created at runtime", "MyButton", DropDownButtonExample.Properties.Resources.About, this.dropDownButton1.Size);
dropDownButton.BringToFront();
// Creates poup menu items.
DevExpress.XtraBars.BarButtonItem item1 = CreateBarButtonItem("Item 1", "item1", 0);
DevExpress.XtraBars.BarButtonItem item2 = CreateBarButtonItem("Item 2", "item2", 1);
// Creates the popup menu and assigns it to the DropDownButton.
dropDownButton.DropDownControl = CreatePopupMenu(new BarItem[] { item1, item2 }, this.barManager1, "MyPopupMenu");
}
(you will be redirected to DevExpress.com to submit your response)