0% found this document useful (0 votes)
6 views

C# Chapter 4

The document discusses the Multiple Document Interface (MDI) design pattern used in GUI applications, where multiple child windows operate within a single parent window. It outlines the features of MDI applications, such as centralized menus and efficient resource management, and provides code examples for defining an MDI parent and creating child forms. Use cases for MDI applications include text editors, spreadsheet applications, and data management tools.

Uploaded by

Salman Sead
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

C# Chapter 4

The document discusses the Multiple Document Interface (MDI) design pattern used in GUI applications, where multiple child windows operate within a single parent window. It outlines the features of MDI applications, such as centralized menus and efficient resource management, and provides code examples for defining an MDI parent and creating child forms. Use cases for MDI applications include text editors, spreadsheet applications, and data management tools.

Uploaded by

Salman Sead
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 8

Programming with Visual C#

Chapter 4

MDI Parent Forms


MDI Forms
 The Multiple Document Interface (MDI) is a
design pattern used in graphical user interface
applications where multiple child windows reside
within a single parent window.
MDI Forms (Example)
Features of MDI Applications
1. Single Parent Window: Contains all child windows.
2. Child Forms: Independent windows within the parent
window, each capable of interacting with the user.
3. Centralized Menu/Toolbar: Shared by all child windows,
providing consistency.
4. Efficient Resource Management: Reduces memory usage
compared to multiple separate applications.
Define the MDI Parent
public Form1()
{
InitializeComponent();
this.IsMdiContainer = true; //
}
Create Child Forms
private void newToolStripMenuItem_Click(object
sender, EventArgs e)
{
ChildForm child = new ChildForm();
child.MdiParent = this; // Set the MDI parent
child.Show(); // Display the child form
}
Use Cases for MDI Applications
• Text Editors: Allowing users to work on multiple
documents.
• Spreadsheet Applications: Supporting multiple
workbooks simultaneously.
• Data Management Tools: Managing multiple
data entry or report generation windows.
Thank you

You might also like