tags:

views:

16

answers:

2

WinForms, how to find all the active windows of specific instance type.

A: 

You could do something like this using LINQ:

var forms = from f in Application.OpenForms.OfType<Form1>()
            select f;

Or if you had additional criteria, something like:

var forms = from f in Application.OpenForms.OfType<CustomerForm>()
            where f.HasChanges
            select f;
Josh Einstein
A: 

Thanks, thats exactly what i was after.

Nick