DXButtonGroupItem Class
A group of buttons that can be displayed within a DXPopupMenu object.
Namespace: DevExpress.Utils.Menu
Assembly: DevExpress.Utils.v18.1.dll
Declaration
Remarks
A DXPopupMenu can be displayed as a regular menu, popup bar or RibbonMiniToolbar object (see DXPopupMenu.MenuViewType). A DXButtonGroupItem object added to a DXPopupMenu is visualized differently depending on the popup menu’s display mode:
To add a DXButtonGroupItem object to a DXPopupMenu, use the popup menu’s inherited DXSubMenuItem.Items property.
Example
The example demonstrates how to add two DXButtonGroupItem objects to a DXPopupMenu, and display the menu as a RibbonMiniToolbar.
using DevExpress.LookAndFeel;
using DevExpress.Utils.Menu;
private void Form1_MouseDown(object sender, MouseEventArgs e) {
Control parentControl = this;
Point pt;
pt = e.Location;
DXPopupMenu dxPopupMenu = new DXPopupMenu();
DXButtonGroupItem buttonGroup = new DXButtonGroupItem();
EventHandler handler = new EventHandler(ItemClick);
buttonGroup.Items.Add(new DXMenuItem("Undo", handler, Image.FromFile("..\\..\\undo32x32.png")));
buttonGroup.Items.Add(new DXMenuItem("Cut", handler, Image.FromFile("..\\..\\cut32x32.png")));
buttonGroup.Items.Add(new DXMenuItem("Redo", handler, Image.FromFile("..\\..\\redo32x32.png")));
dxPopupMenu.Items.Add(buttonGroup);
buttonGroup = new DXButtonGroupItem();
buttonGroup.Items.Add(new DXMenuItem("Bold", handler, Image.FromFile("..\\..\\bold32x32.png")));
buttonGroup.Items.Add(new DXMenuItem("Italic", handler, Image.FromFile("..\\..\\italic32x32.png")));
buttonGroup.Items.Add(new DXMenuItem("Underline", handler, Image.FromFile("..\\..\\underline32x32.png")));
dxPopupMenu.Items.Add(buttonGroup);
dxPopupMenu.Items.Add(new DXMenuItem("About",handler));
dxPopupMenu.Items.Add(new DXMenuItem("Exit",handler));
dxPopupMenu.MenuViewType = MenuViewType.RibbonMiniToolbar;
((IDXDropDownControl)dxPopupMenu).Show(RibbonControl1, parentControl, pt);
}
void ItemClick (object sender, EventArgs e) {
DXMenuItem item = sender as DXMenuItem;
//You can identify an item by its caption
//...
}
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the DXButtonGroupItem class.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.