You could give
Form2
a constructor accepting an enumeration of integers as parameter, which you would use to populate the second listbox:
public Form2()
{
InitializeComponent();
}
public Form2(IEnumerable<int> values) : this()
{
theSecondListBox.Items.AddRange(values);
}
You would then instantiate the
Form2
instance by using the new constructor:
Form2 form = new Form2(theFirstListBox.Items.Where(i => i > 0 && i < 101));