Lets say I have a listBox with 10 elements, and I put the first 4 elements in a List list1, and the rest of elements in another List list2:
list2 = listbox.remove(list1);
Something like this. Is this posible ?
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can do this easily with LINQ:
However,
Exceptneeds to compare the items inlistand the items inlistboxto produce its results. The above example (default behavior) assumes that the type of the items in the lists are uniquely identified by a reference comparison (which sounds fine in this case).If the class implements
IEquatable<T>and/or overridesEquals, thenExceptuses that method to test for equality.