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

How to: Merge Ribbon Controls

  • 2 minutes to read

This example demonstrates the merging mechanism for RibbonControls in action. The main and child MDI forms contain RibbonControls. The child form's RibbonControl is merged into the main form's RibbonControl when the child form is maximized.

View Example

private void Form1_Load(object sender, EventArgs e) {
    // Enable the form's title bar transparency
    //this.AllowFormGlass = DevExpress.Utils.DefaultBoolean.False;
    // Specify that the merge mechanism should be invoked when a child MDI form is maximized.
    this.ribbonControl1.MdiMergeStyle = RibbonMdiMergeStyle.OnlyWhenMaximized;
    CreateChildForm();
}
private void btnNew_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) {
    CreateChildForm();
}
int ctr = 1;
void CreateChildForm() {
    // Create an MDI child form, containing a RibbonControl
    ReportForm child = new ReportForm();
    child.Text = "Report " + ctr.ToString();
    child.MdiParent = this;
    child.Show();
    ctr++;
}