Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0
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 form.here 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
good
Please Sign up or sign in to vote.

Solution 1

Hi,
 
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.
  Permalink  
v2
Rate this: bad
good
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.
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 359
1 Richard MacCutchan 310
2 OriginalGriff 290
3 Sharmanuj 146
4 Jared Sanow 145
0 Sergey Alexandrovich Kryukov 5,969
1 OriginalGriff 5,005
2 CPallini 2,473
3 Richard MacCutchan 1,547
4 Abhinav S 1,507


Advertise | Privacy | Mobile
Web01 | 2.8.140814.1 | Last Updated 16 Feb 2013
Copyright © CodeProject, 1999-2014
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