Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old May 29th, 2007, 09:48 AM
Registered User
Join Date: May 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problems with MDI Forms

Hi, I'm have a problem creating an MDI Form application and Im hoping someone can shed some light on it for me. I will try to provide as much information as I can as to what is happening and what I am trying t achieve.

My Application has a main MDIParent / Container and when the aplication starts, a Child Window is created which is just a little toolbar which will in turn spawn additional child forms. The problem is when I resize one of the Child forms, they all resize.

Here is the code that I am using on the click event of one of the buttons on the "Toolbar" (Child Form)..

            frmStatus form1 = new frmStatus();
            form1.MdiParent = this.MdiParent;
            form1.WindowState = FormWindowState.Maximized;

So I create a new instance of form, set its MdiParent to the Parent of the "Toolbar" (Child Form) which makes its Parent the main MDIContainer. I do this so I can easaily track MDI Children in a Window Menu. I then set its Window State to be maximised and show the form.

This works perfectly, the form goes full screen (inside the MDI Container of course), its name appear in the Window menu, however when the new Child form is created, it is also resizing the "Toolbar" form to be maximized aswell..

How can i get it so that I can maximise just a single MDI Child without affecting another.

Please let me know if I need to provide any further information.

Thanks in advance.

Kind Regards,

Old December 19th, 2008, 12:06 AM
Posts: n/a

Any one know the answer for the above ?

I came into the same situation, (ie. when one child form is maximized all other form gets maximized)

Please reply ASAP

Old December 20th, 2008, 12:05 PM
Friend of Wrox
Join Date: Sep 2008
Posts: 234
Thanks: 0
Thanked 32 Times in 30 Posts
Default MDI Issues

Keep in mind that the main form is not the parent of an MDI child form. It is the MDIClient that assumes this responsibility. Do a Google on the MDIClient and you will be directed to several related topics that address your problem. You should also remember that form.Show() and form.ShowDialog() differ with respect to the parent window.

Dr. Purdum
Jack Purdum, Ph.D.
Author: Beginning C# 3.0: Introduction to Object Oriented Programming (and 14 other programming texts)
The Following User Says Thank You to DrPurdum For This Useful Post:
Old December 22nd, 2008, 12:46 PM
Registered User
Join Date: Dec 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

Thanks a lot for the solution. It did solve the similar problem i had.
Old December 22nd, 2008, 11:39 PM
Posts: n/a

I solved the problem, making the specific forms to Dialogs.

Similar Threads
Thread Thread Starter Forum Replies Last Post
MDI & MDI Child Forms Menu's in VB2005 yulyos Visual Studio 2005 0 September 7th, 2007 09:49 AM
MDI Forms kobystud C# 0 June 7th, 2004 04:14 AM
Mdi Forms tim33_909 Pro VB.NET 2002/2003 1 November 27th, 2003 11:40 PM
MDI Forms tim33_909 VB.NET 2002/2003 Basics 1 November 17th, 2003 03:42 PM
MDI Forms? aldwincusi VB How-To 1 September 11th, 2003 04:46 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.