DotNetBar RibbonBarMergeContainer support automatic RibbonBar merging for the MDI Child user interface scenario. You can also use RibbonBarMergeContainer for custom merging scenarios that do not involve the MDI forms.

To do so you will use two methods on RibbonBarMergeContainer:

  • To perform merge into the ribbon control you will call:
  • To remove merged ribbons from the ribbon control you will call:

You will also need to perform selection of RibbonTabItem that were created (if desired) when RibbonBar controls are merged as well as handle the case when selected RibbonTabItem that was created during merge is removed.

Sample below shows how to do that using for example UserControls. It merges the RibbonBar controls from active UserControl into the RibbonControl. It also shows how to avoid the Windows Forms focus bug which is exposed when controls are removed from the Controls collection and container control does not have an active control.

Sample application:

Related posts:

  1. How To Control RibbonBar Merge Order
  2. Tips when working with Ribbon control from code
  3. How to loop through all ribbon tabs, ribbon bar and items on WinForms Ribbon control
  4. Ribbon Control re-sizing modes and support for different DPI settings
  5. Ribbon Quick Access Toolbar Customization