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

Posted on 2005-03-28
Medium Priority
Last Modified: 2008-03-10
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.
Question by:Shemmie
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
LVL 12

Accepted Solution

S-Twilley earned 1000 total points
ID: 13650083
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.
LVL 25

Expert Comment

ID: 13650128
Just set the maximumsize property height of your child form to the size of the container minus your taskbar

Author Comment

ID: 13650198
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.
LVL 12

Expert Comment

ID: 13650218
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

Author Comment

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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question