tags:

views:

34

answers:

1

I have a winforms application with multiple Forms open where only the mainform shows up in the taskbar.

For the other forms I have used ShowInTaskbar = false.

Let's say another application is the top window so I can't see any of my application windows

When clicking my application icon on the taskbar I want all my forms belonging to this application to be visible on top.

I have tried this but the FormCollection contains only my MainForm

private void MainForm_Activated(object sender, EventArgs e)
    {
        FormCollection FC = Application.OpenForms;
        foreach (Form appform in FC)
        {
            appform.Activate();
            appform.Show();
        }                
    }

How do I get a list of all forms ?

A: 

Maybe this will help.