# MDI Child RibbonForm

## Content



The **Ribbon** control supports **MDI (Multiple document Interface) Child Ribbon Forms**, which is quite useful in user interaction. This section illustrates how to create MDI Child forms using the Ribbon control.

The RibbonForm can be used in MDI scenarios. The MDI feature lets you share a single menu bar between all child windows, increasing the efficiency of screen space usage.

![GIF showing a new form on clicking File tab](https://cdn.mescius.io/document-site-files/images/5560dc72-88a5-4eeb-a384-981194dfc831/images/mdi-gif.gif)

## Creating MDI form

In order to create an MDI parent RibbonForm and child form, follow the steps below:

1.  Create a RibbonForm.
    
    ```csharp
    partial class Form1 : C1RibbonForm
    {
        //...
    }
    ```
    
2.  Set up the MDI parent form by setting **Form.IsMdIContainer** property to true, and make the window maximized.
    
    ```csharp
    public ParentForm()
    {
        InitializeComponent();
        this.Text = "Parent Form";
        this.IsMdiContainer = true;
        this.WindowState = FormWindowState.Maximized;
    }
    ```
    
3.  Add tool strip menu items, 'New' and ‘Open’ buttons to the menu strip in the RibbonForm, such that on clicking each button a child form opens, NewForm and OpenForm (which, we will create in the next step).
    
4.  Add the following code to create and display the MDI child form 'NewForm' and assign border size to the MDI Child Form using the **MdiChildBorder** property in the **ToolStripMenuItem\_Click** event for the **New** button.
    
    ```csharp
    private void newToolStripMenuItem_Click(object sender, EventArgs e)
    {
        NewForm cfrm1 = new NewForm();
        //Set MdiChildBorder property for a child C1RibbonForm
        cfrm1.MdiChildBorder = 2; 
        cfrm1.MdiParent = this;
        cfrm1.StartPosition = FormStartPosition.CenterScreen;
        cfrm1.Show();
    }
    ```
    
5.  Add the following code to create and display the MDI child form 'OpenForm' using the **ToolStripMenuItem\_Click** event for the **Open** button.
    
    ```csharp
    private void openToolStripMenuItem_Click(object sender, EventArgs e)
    {
        OpenForm cfrm2 = new OpenForm();
        cfrm2.Show();
        cfrm2.MdiParent = this;
    }
    ```