i need to display list of opened forms in windows application(windows forms) c#. can anyone tell me how to store open form names and display it .... i need display like below
e.g
open form names
- form1
- form2
how to do it. can anyone help me...
i need to display list of opened forms in windows application(windows forms) c#. can anyone tell me how to store open form names and display it .... i need display like below
e.g
open form names
how to do it. can anyone help me...
Use Application.OpenForms
collection:
var names = Application.OpenForms.Cast<Form>().Select(f => f.Name);
If you want types of opened forms, then select f.GetType().Name
If you want system wide you can use EnumWindows to get all top level windows, your question isn't clear about exactly what you're after.
var names = Application.OpenForms.Cast().Select(f => f.Name);