RibbonMiniToolbar.ItemLinks Property
Provides access to a collection of item links displayed by the toolbar.
Namespace: DevExpress.XtraBars.Ribbon
Assembly: DevExpress.XtraBars.v24.1.dll
NuGet Package: DevExpress.Win.Navigation
Declaration
[Browsable(false)]
[InheritableCollection]
public RibbonMiniToolbarItemLinkCollection ItemLinks { get; }
Property Value
Type | Description |
---|---|
DevExpress.XtraBars.Ribbon.RibbonMiniToolbarItemLinkCollection | A RibbonMiniToolbarCollection object that contains item links displayed by the toolbar. |
Remarks
To display item links in the toolbar, add these to the ItemLinks collection.
Example
The following example demonstrates how to create a RibbonMiniToolbar and add buttons to the toolbar. The toolbar is displayed on right-clicking a form.
Note, that the toolbar needs to be added to the RibbonControl.MiniToolbars collection to ensure it will display correctly.
using DevExpress.XtraBars;
using DevExpress.XtraBars.Ribbon;
RibbonMiniToolbar rtb;
public Form1() {
InitializeComponent();
rtb = new RibbonMiniToolbar();
rtb.ParentControl = this;
RibbonControl1.MiniToolbars.Add(rtb);
BarButtonItem itemNew = new BarButtonItem(RibbonControl1.Manager, "New");
rtb.ItemLinks.Add(itemNew);
itemNew.Glyph = Image.FromFile("..\\..\\new16x16.png");
itemNew.LargeGlyph = Image.FromFile("..\\..\\new32x32.png");
BarButtonItem itemOpen = new BarButtonItem(RibbonControl1.Manager, "Open");
rtb.ItemLinks.Add(itemOpen);
itemOpen.Glyph = Image.FromFile("..\\..\\open16x16.png");
BarButtonItem itemSave = new BarButtonItem(RibbonControl1.Manager, "Save");
rtb.ItemLinks.Add(itemSave);
itemSave.Glyph = Image.FromFile("..\\..\\save16x16.png");
BarButtonItem itemPrint = new BarButtonItem(RibbonControl1.Manager, "Print");
rtb.ItemLinks.Add(itemPrint);
itemPrint.Glyph = Image.FromFile("..\\..\\print16x16.png");
BarButtonItem itemExit = new BarButtonItem(RibbonControl1.Manager, "Exit");
rtb.ItemLinks.Add(itemExit);
itemExit.Glyph = Image.FromFile("..\\..\\exit16x16.png");
}
private void Form1_MouseClick_1(object sender, MouseEventArgs e) {
if (e.Button == System.Windows.Forms.MouseButtons.Right) {
rtb.Show(PointToScreen(e.Location));
}
}
See Also