• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 395
  • Last Modified:

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.
 
0
Shemmie
Asked:
Shemmie
  • 2
  • 2
1 Solution
 
S-TwilleyCommented:
If you use a Panel control as your taskbar within the MDI parent form... and dock it at the bottom, your maximized child forms shouldn't overlap or go past it, I did a quick test and it seems to work.
0
 
RonaldBiemansCommented:
Just set the maximumsize property height of your child form to the size of the container minus your taskbar
0
 
ShemmieAuthor Commented:
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.
0
 
S-TwilleyCommented:
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
0
 
ShemmieAuthor Commented:
Ah... to prevent windows being dragged behind the panel? Thanks for the heads up. :o)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now