Maximized forms in MDI

G

Guest

Hi. I basically have an MDI application with many 'child' forms, and am having difficulties with form WindowStates. Most child forms in my app should run in FormWindowState.Normal (or .Minimized) only, and I have disabled the Maximize buttons for them. Most of the time, this works fine, but I am having difficulty in certain situations. One child form can run maximized (it is meant to), but when it is already open and maximized, and I open another form, this opens maximized as well. This happens despite the fact that the new form's WindowState property is set to Normal, and its MaximizeButton is disabled.

Can I make the new form open in FormWindowState.Normal mode?

I hope this is clear, and many thanks in advance,
 
Y

Ying-Shen Yu[MSFT]

Hi James,

Unfortunately, this is the default behavior in native MDI Child Window
DefMDIChildProc , there is no easy way to change this it. Can you make
those windows should not show maximized as tool window instead of MDI
children window?

Best regards,

Ying-Shen Yu [MSFT]
Microsoft Community Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.
 
G

Guest

Thanks for your reply. Unfortunately, since I have about 17 windows of which only 1 should run maximized, I cannot make them all tool windows. Is there an event to check when the maximized form loses focus ('Deactivated' doesn't work), so I could change the windowstate.
 
G

Guest

Thanks for your reply. Unfortunately, since I have about 17 windows of which only 1 should run maximized, I cannot make them all tool windows. Is there an event to check when the maximized form loses focus ('Deactivated' doesn't work), so I could change the windowstate.
 
G

Guest

Thanks for your reply. Unfortunately, since I have about 17 windows of which only 1 should run maximized, I cannot make them all tool windows. Is there an event to check when the maximized form loses focus ('Deactivated' doesn't work), so I could change the windowstate.
 
Y

Ying-Shen Yu[MSFT]

Hi James,

Thanks for your reply.
You may get the activation change between MDI child windows by handling the
MdiChildActivate event, But unfortunately, as the MDI WndProc requires
handling the WM_CHILDACTIVATE message, it will force the all the MDI
children window in the same window state.
Using Tool Window might be a better way.

Did you need some MDI feature in these Forms? ( such as MDI menu merge etc
..) If not, maybe you can try making the form needs maximized as a non-top
level window of the Form ( by setting TopLevel to false and set Parent the
main form),

Thanks!

Best regards,

Ying-Shen Yu [MSFT]
Microsoft Community Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.
 

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