Is it possible to cast a ListBox.SelectedObjectCollection to a ListBox.ObjectCollection in C#? If so, how would I go about it?
I have a function that accepts List<string>
.
I can pass both SelectedItems and Items by casting them.
Try this:
SelectedItems.Cast<string>().ToList()
Items.Cast<string>().ToList()
<string>
could be replaced with some other object type.