Start off with
var forms = Application.OpenForms.Cast<Form>().ToList();
Which to get details say in a ListBox create a class for displaying forms as a List<FormItem>
public class FormItem
{
/// <summary>
/// Name of form
/// </summary>
public string DisplayName { get; set; }
/// <summary>
/// Actual form instance
/// </summary>
public Form Form { get; set; }
public override string ToString() => DisplayName;
}
Assign the DataSource of a ListBox using
List<FormItem> formNames = Application
.OpenForms
.Cast<Form>()
.Select(form => new FormItem
{
DisplayName = form.Name,
Form = form
}).ToList();
For selection changed of the ListBox cast selected item to FormItem.
Then something like this (hard coded)
formNames.FirstOrDefault().Form.Activate();