Search code examples
winformslayoutribboninfragisticsmdi

Infragistics ribbon goes over maximized MDI child


I'm using UltraToolbarsManager from Infragistics NetAdvantage WinForms bundle (v 2012 2) to introduce ribbon toolbars in an existing WinForm application.

I set up the main ribbons in the main MDI container form and then set up an additional ribbon in a manager inside a child form.
MdiMergeable property is set to true in both forms.

Child form is set up to fill all available area in the MDI parent:
- FormBorderStyle = FormBorderStyle.None
- Dock = DockStyle.Fill
- No control boxes

The problem is that when I show() my child form it takes all area, the toolbars merged correctly, but i see the form border. When I double click the top border of the form, the border disappears and the MDI child shows correctly (or, better, as I want).

If I change the form styling this way:
Dock = DockStyle.Fill => WindowState = FormWindowState.Maximized

The form top goes under the ribbon and it's partially hidden by it.


Solution

  • Set the following properties:

    • FormBorderStyle = FormBorderStyle.None
    • Dock = DockStyle.None

    During the form object construction and postpone to just before the display (the Layout event) this setting:

    • WindowState = FormWindowState.Maximized

    And the form is correctly displayed.

    I think that, when I set this values during the construction of the form object, the MDI child available area does not take into account the space occupied by the ribbon (maybe the available area is evaluated before the ribbon occupies part of it).
    When I postpone the setting of WindowState = FormWindowState.Maximized until the Layout event, the MDI child available area takes into account the space occupied by the ribbon.