Andrea Colleoni
Andrea Colleoni

Reputation: 6021

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.

Upvotes: 0

Views: 1364

Answers (2)

Andrea Colleoni
Andrea Colleoni

Reputation: 6021

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.

Upvotes: 0

alhalama
alhalama

Reputation: 3228

The issue with the form border showing isn't present if you don't set Dock to DockStyle.Fill and the Window will still take the entire area of the MDI parent when it is maximized.

Unless you have a specific reason for setting DockStyle.Fill I would recommend leaving it DockStyle.None.

Note that you will see similar behavior if you remove the Ribbon and use a Microsoft MenuStrip in its place so the Ribbon doesn't seem to affect this behavior.

Upvotes: 1

Related Questions