1
votes

My MDI application shows one maximized child form at a time, and the child forms have no ControlBox. Switching child forms is done via items in a MenuStrip in the parent. Do I really need to figure out which child form is showing and .hide it before using .show to see another?

Also, if I set the WindowState property to Maximized for all Child forms and ignore the Size property, the first time I use .show on a Child form, it is NOT maximized in the parent. Once I use .hide on the child, the next .show yields a maximized child form. Is there a way to see the child form maximized the first time it is shown?

1
There's no point in using MDI for this kind of windowing model. It just gets in the way.Hans Passant

1 Answers

0
votes
  1. You normally don't need to hide one mdi child before you show the next one, but it is possible for the timing to get mixed up, in which case the wrong form can end up on top. This might happen at startup or when loading or closing a file.

  2. Probably the child form is loading before the parent completes loading, when the parent is not yet maximized. The child form may be correctly maximized in the parent, but then the parent gets bigger. You can probably fix this by setting the child form to maximimzed (or resizing it?) in the parent's Shown event. You might also do this in the parent's ResizeEnd event.

As Hans says, it is more socially acceptable to use Tabs now instead of MDI, assuming you have the time for the change.