RibbonControl.MiniToolbars Property

Provides access to the collection of RibbonMiniToolbar objects.

Namespace: DevExpress.XtraBars.Ribbon

Assembly: DevExpress.XtraBars.v20.1.dll

Declaration

[DXCategory("Appearance")]
[SkipRuntimeSerialization]
public RibbonMiniToolbarCollection MiniToolbars { get; }
<DXCategory("Appearance")>
<SkipRuntimeSerialization>
Public ReadOnly Property MiniToolbars As RibbonMiniToolbarCollection

Property Value

Type Description
RibbonMiniToolbarCollection

A RibbonMiniToolbarCollection object that is the collection of RibbonMiniToolbar objects.

Remarks

To use a RibbonMiniToolbar object, it must be added to the MiniToolbars collection.

Examples

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.

Ribbon Mini Toolbar

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