Using Ribbon wtih MDI (Multi Document Interface)
The following guide will show how to apply this ribbon with an MDI (Multi Document Interface) enabled WinForm.
Note: In previous version of Ribbon, inheritance of RibbonForm is not supported well with MDI Enabled WinForm. This problem is solved in released version of 10 May 2013.Sample codes for
VB.NET available at
Downloads section.
Start
1. Lets design a ribbon winform something like this as example. In the properties window, set
IsMdiContainer to
True.

2. Create another simple another form that will be loaded into the MDI Container of MainForm.

3. At code behind of Form1, add in the below codes:
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
this.ControlBox = false;
this.WindowState = FormWindowState.Maximized;
this.BringToFront();
}
}
4. At code behind of MainForm, create the click events for RibbonButton at MainForm:
Note: In previous version of Ribbon, inheritance of RibbonForm is not supported well with MDI Enabled WinForm. This problem is solved in released version of 10 May 2013.
public partial class MainForm : RibbonForm
{
public MainForm()
{
InitializeComponent();
}
private void ribbonButton_Form1_Click(object sender, EventArgs e)
{
// Load Form1
}
private void ribbonButton_Close_Click(object sender, EventArgs e)
{
// Close All Forms
}
}
5. Codes for loading Form1 into MDI:
private void ribbonButton_Form1_Click(object sender, EventArgs e)
{
foreach (Form f in this.MdiChildren)
{
if (f.GetType() == typeof(Form1))
{
f.Activate();
return;
}
}
Form form1 = new Form1();
form1.MdiParent = this;
form1.Show();
}
6. Codes for closing all opened form in MDI:
private void ribbonButton_Close_Click(object sender, EventArgs e)
{
while (this.ActiveMdiChild != null)
{
this.ActiveMdiChild.Close();
}
}
7. That's it. Enjoy.