
Introduction
WinForm MDI child windows do not minimize to icons. This article provides MDI Parent/Child classes that support minimize-to-icon functionality.
Background
Standard MDI application allows Child forms to be minimized. Alas, child windows minimize to a mere rectangle:

This article combines Forms Regions and MDI Parent/Child logic, to allow child windows to be minimized to Icons.
Using the Code
The code includes two classes: MinimizableForm
and MinimizingFormParent
.
The parent Form inherits from MinimizingFormParent
, and the child form inherits from MinimizableForm
.
public partial class <MDI Parent class name> : MinimizingFormParent
public partial class <MDI Child class name> : MinimizableForm
Included are two templates, a Minimizing MDI VS2013 Project Template, as well as Minimizing MDI Child Form VS2013 Item Template. These should be placed under %UserProfile%\Documents\Visual Studio 2013\Templates\ProjectTemplates and %UserProfile%\Documents\Visual Studio 2013\Templates\ItemTemplates respectively.
These templates facilitate creating an initial project, as well as allowing additional MDI Child Forms to be added.
Points of Interest
Reference
Setting the Child's Form region is a critical part of the solution (See the excellent article by Weiye Chen, Creating Bitmap Regions for Forms and Buttons, which serves as basis for this code.) Another is tracking/locating the minimized child windows.
MDI Child List Menu Item
MDI Child window list is automatically built using the MenuItem
property (note a similar property exists for classic MDI children, using the MenuStrip
MdiWindowListItem
property.)

Code Support
The new Parent MDI form (MinimizingFormParent
), supports the LayoutMDI
method. Child form state is reflected (and may be modified) via MinimizableForm.WindowState
Constructors
The child form supports multiple Icon sources, and thus has multiple constructors:
MinimizableForm()
MinimizableForm(int iconSize)
MinimizableForm(String iconFile)
MinimizableForm(Bitmap iconBitmap)
Child Area
(This is well known...) The MDI Parent hosts all MDI children under a MdiClient
control. MDI child windows live under this control, whose size is MdiClient.DisplayRectangle.Size
. This, rather than MdiParent.ClientRectangle
should be used when placing icons, as well as tiling client windows.
History
- September 26th, 2014 -- Original version
- September 27th, 2014 -- Added Project/Item Templates