Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

RibbonControl.MiniToolbars Property

Provides access to the collection of RibbonMiniToolbar objects.

Namespace: DevExpress.XtraBars.Ribbon

Assembly: DevExpress.XtraBars.v24.2.dll

NuGet Package: DevExpress.Win.Navigation

#Declaration

[DXCategory("Appearance")]
[SkipRuntimeSerialization]
public RibbonMiniToolbarCollection MiniToolbars { get; }

#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.

#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.

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