MDI child minimized/maximized problem
Posted on 2004-09-11
I have an MDI app in which I want to open the first MDI child window in a maximized state.
I also want to set the width and height of the child window (when it is first loaded) so that if/when the user "restores" the MDI child (i.e. un-maximizes it) then it will resize to the width and height previously set.
My code currently does this:
1. Create the MDI child form.
2. In the Form Show event, load the required WindowState (wsMaximized or wsNormal) state from a config file and set the MDI child window's WindowState accordingly.
3. In the Form Show event, load the required width and height from a config file and set the MDI child's width and height accordingly.
Now the Problem...
When I set the width of the maximized MDI child window, it becomes un-maximized.
So, how can I set the width without un-maximizing the MDI child window?
Ideally, I want to be able to create the *first* MDI child window in a maximized state, *and* set it's width and height (and left and top) so that when a user unmaximizes the MDI child window it is positioned and resized to the appropriate position and size.