Link to home
Start Free TrialLog in
Avatar of Shemmie
Shemmie

asked on

MDI Forms: Restricting the 'Maximize' size of a child form.

Hi there,

Essentially I'm trying to replicate Windows desktop funcionality.

I've got my Parent MDI set up to act as a 'desktop', including a label anchored to the bottom to act as my 'task bar'.

What I want to be able to do, is to restrict the 'Maximize' size of all child windows, to prevent them covering my 'taskbar'. When you maxmimize any window within Windows, the size will be constrained by the task bar. That's what I want to be able to do.

I hope I've explained that clearly, but any problems, please feel free to ask. Thanks for your time.
 
ASKER CERTIFIED SOLUTION
Avatar of S-Twilley
S-Twilley

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RonaldBiemans
RonaldBiemans

Just set the maximumsize property height of your child form to the size of the container minus your taskbar
Avatar of Shemmie

ASKER

Thanks for the prompt replies. After posting I came across the property you suggested RonaldBiemans, but having tested the Panel, I just moved all my existing task bar (a few labels and buttons) to the Panel, docked the Panel, and it works perfectly, thanks S-Twilley.
No problem... you might want to look into the Cursor.Clip method for preventing the user from resizing or moving things out of bounds and then releasing the Clip on the mouseup...  just as a hint/idea
Avatar of Shemmie

ASKER

Ah... to prevent windows being dragged behind the panel? Thanks for the heads up. :o)