I Have to form form1 and form2 and i want to transfer the all selected items of a listbox of Form1 To listbox of Form2 ..Please help me..
Thanks
Shailendra
How we transfer items of a listbox of a form to another form
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Jaish MathewsRank #225 · 11K reputationPosted Apr 15, 2010, 8:24 AM EDT
//Create a property like below in Form1
public static ListBox.SelectedObjectCollection GetSelectedListItems
{
get;
set;
}
//When need to move to Form2, execute below lines in Form1
GetSelectedListItems = listBox1.SelectedItems;
//From Form2 take values using below code
IEnumerator enumer = Form1.GetSelectedListItems.GetEnumerator();
while (enumer.MoveNext())
{
MessageBox.Show(enumer.Current.ToString());
}
Shailendra Verma47 reputationPosted Apr 15, 2010, 10:15 PM EDT