I\'d like your advice on the following issue: We are studying different User Interface solutions for an Windows Forms application we are developing and we have come to the concl
By design, children of an MDI form do not show up in the Taskbar. It's best to stick to this principle.
On Windows 7, you can add a 'thumbnail' for an MDI child to the task bar but this functionality is not available directly in .net. You can check MSDN for the additional APIs.
There is a work-around, though: when selecting a form you can detach it from the MDI parent. You have to make sure that it is re-attached when a new child form is selected. Add the following code to your MDI container form:
private Form focusedChild;
private void CreateWindow()
{
Form window = new Form();
window.GotFocus += new EventHandler(Child_GotFocus);
window.Show();
}
void Child_GotFocus(object sender, EventArgs e)
{
Form window = sender as Form;
if (null != window)
{
if (focusedChild != null && window!=focusedChild)
{
focusedChild.SuspendLayout();
focusedChild.MdiParent = null;
focusedChild.WindowState = FormWindowState.Minimized;
focusedChild.ResumeLayout();
}
window.SuspendLayout();
window.MdiParent = this;
window.WindowState = FormWindowState.Maximized;
window.ResumeLayout();
focusedChild = window;
}
}
I would not recommend this, however. Stick to the default behaviour, or look at the Windows 7 thumbnails if your app will run on Windows 7.