Reputation: 24102
So I'm iterating through all the checked items in the box like this:
for (int i = 0; i < listFiles.CheckedItems.Count; i++)
{
}
This works but how do I access the display name property of each of the checked items as I get to it. Seems simple but I can't find it.
Upvotes: 1
Views: 2532
Reputation: 263147
If you don't use the DisplayMember property to customize the way your items are rendered, you only need to call their ToString() method:
foreach (object item in listFiles.CheckedItems) {
string displayName = item.ToString();
// ...
}
Upvotes: 2