0% found this document useful (0 votes)
90 views3 pages

How To Create Maximize Child MDI Form in Windows Forms Application

This document provides steps to create a maximized child MDI form in a Windows Forms application using C# in Visual Studio. The steps include: 1) creating a new Windows Forms app with Form1 as the MDI container, 2) adding a second form Form2 as the child form, 3) writing code in Form1's load event to set Form2 as the child form, and 4) overriding Form2's resize event to maximize it when loaded. Following these steps results in Form2 automatically opening in a maximized state within the MDI parent Form1.

Uploaded by

ProgramInUrdu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
90 views3 pages

How To Create Maximize Child MDI Form in Windows Forms Application

This document provides steps to create a maximized child MDI form in a Windows Forms application using C# in Visual Studio. The steps include: 1) creating a new Windows Forms app with Form1 as the MDI container, 2) adding a second form Form2 as the child form, 3) writing code in Form1's load event to set Form2 as the child form, and 4) overriding Form2's resize event to maximize it when loaded. Following these steps results in Form2 automatically opening in a maximized state within the MDI parent Form1.

Uploaded by

ProgramInUrdu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Title: To Create Maximize Child MDI form In Windows Forms Application

Requirements: Windows Forms Application, C# and Visual Studio 2005 or later

Notes: Screen Shot Taken In Visual Studio 2017

Step 1: Create a New “Windows Forms App” in Visual Studio 2017 as shown below.

Step 2: Once the application is created, it will have a default “Form1.cs” file. Go to Properties
Windows for Form1 and set “IsMdiContainer” property as “False” as shown below.
Step 3: Now add another Windows Form with the name Form2.cs as shown below.

Step 4: Double click on Form1, it will generate Load event as shown below.

Step 5: Now add the code below to the Load event.

Form2 frm = new Form2();


frm.MdiParent = this;
frm.Show();

The first line will create a new object of Form2. The 2nd line will set the “MDI” as Form1 (this
keyword refers to Form1) and in the final line, Form2 will be shown as Child form in Form1.
Step 6: Till now, the child Form2 will be shown as small windows in MDI. To make it maximize, in
Form2, go to the Code View and override OnResize event as shown below.

The result is shown below.

You might also like