Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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 form.here i maximize the form to windows size. but i want to open like msword or notepad.
Posted
Updated 8-Dec-19 9:22am

Hi,

Here is the code
C#
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.
 
Share this answer
 
v2
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.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900