Click here to Skip to main content
13,143,693 members (30,193 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hi friends

I have one parent form with menustrip control and lot of child form. when i click child form it open as a small window inside the parent form. but i would like to open all child window with same width of parent i maximize the form to windows size. but i want to open like msword or notepad.
Posted 15-Feb-13 22:49pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1


Here is the code
Childform cf = new Childform ();
           cf .MdiParent = this;
           cf .ClientSize = new System.Drawing.Size(2000, 800);
           this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
           cf .FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
           cf .Dock = DockStyle.Fill;
           cf .Show();

Don't forget to change anchor properties. I hope this helps.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

It sounds like you have built an MDI application - in this case, all the children are contained within the border of the parent application, and cannot be any larger than the client area of the parent. You can make a child fill teh parent client area very easily: just set the WindowState property to FormWindowState.Maximized but you cannot make it fill the screen, or appear outside the bound of the parent.

To get the child outside, you have to just not set the MDIParent property before you show the form.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.170915.1 | Last Updated 16 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100