MDI Child, incorrect maximize of forms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a MDI windows client written in C#. I try to control maximize and
normal size of forms by using:

this.WindowState = FormWindowState.Normal;

If I have a maximized MDI child form and open another child form containing
the line of code above both child forms end up in Normal state. It seems I
cannot control the size of forms on an individual basis.

If I have a maximized MDI child form and open another child form without the
line of code above both forms end up as maximized, although the WindowState
of the latter is set to "Normal" in the form designer properties.

How can I control the WindowState for each form in an MDI application?
Should I use some other property of the form to control maximimized versus
normal WindowState?

Regards

Tore
 
If I have a maximized MDI child form and open another child form without the
line of code above both forms end up as maximized, although the WindowState
of the latter is set to "Normal" in the form designer properties.

How can I control the WindowState for each form in an MDI application?

AFAIK you can't. This is the normal behaviour of MDI windows under the
current versions of Windows. Have a look at other MDI applications such as
MS Excel and you'll see the same behaviour.
 
I forgot to to mention that I am running Visual Studio 2005. The project is
written in C#.

Tore
 
Excel does not always have this behaviour:
If you have a maximized Excel application and then go to the "Format" menu
and choose "Cells" you will open a new window that is not maximized. This
kind of behaviour would do the job for me. How can I implement this in my MDI
application?

Regards

Tore
 
Excel does not always have this behaviour:
If you have a maximized Excel application and then go to the "Format" menu
and choose "Cells" you will open a new window that is not maximized. This
kind of behaviour would do the job for me. How can I implement this in my MDI
application?

When you choose "Cells" in Excel, it simply displays a modal dialog box,
not an MDI child window. This dialog box does not belong to the MDI parent
window and can be moved by the user outside the bounds of the MDI parent.
If this is what you want, then simply create a normal Form and show it with
ShowDialog (or Show if you want it to be non-modal).
 
Thanks

Tore

Mehdi said:
When you choose "Cells" in Excel, it simply displays a modal dialog box,
not an MDI child window. This dialog box does not belong to the MDI parent
window and can be moved by the user outside the bounds of the MDI parent.
If this is what you want, then simply create a normal Form and show it with
ShowDialog (or Show if you want it to be non-modal).
 
Back
Top