MDI Child, incorrect maximize of forms

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
 
M

Mehdi

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.
 
G

Guest

I forgot to to mention that I am running Visual Studio 2005. The project is
written in C#.

Tore
 
G

Guest

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
 
M

Mehdi

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).
 
G

Guest

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).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top