Multiple Document Interface

Just as controls can be grouped into containers, windows themselves can be grouped into containers in a style of application called Multiple Document Interface (MDI). MDI was invented as a way to contain a set of related windows in a single frame, as shown in Figure 2.31.

Figure 2.31. Sample MDI Form

An MDI form has two pieces: a parent and a child. You designate the parent form by setting the IsMdiContainer property to true, and you designate the child form by setting the MdiParent property before showing the form:

void InitializeComponent() {
  ...
  this.IsMdiContainer = true; ... } void cmdFileNewChild_Click(object ...

Get Windows Forms Programming in C# now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.