There are numerous ways to accomplish this. Here are a couple:
1.) You could create a custom form with a constructor that takes your list as a parameter and assigns it to a private variable. Use this private variable as the source of what you display:
public class PopupWindow : Form
{
private List<T> selected_list = new List<T>();
public PopupWindow(){ InitializeCompnent(); }
public PopupWindow( List<T> passed_in ) : this()
{
this.selected_list = passed_in;
}
}
2.) Another way is to create your form with a public property that you can assign your list to after instantiation. The property would assign to a private variable, which would be the source of your display:
public class PopupWindow : Form
{
private List<T> selected_list = new List<T>();
public PopupWindow(){ InitializeCompnent(); }
public List<T> SelectedItemList
{
get { return this.selected_list; }
set { this.selected_list = value; }
}
}
You will need to replace
List<T>
with whatever your list of selected items is in these examples.