Usually, when someone goes through list items, they try to determine if they are selected or not. If so, try using listBoxObject.SelectedItems instead of listBoxObject.Items. This will only return the items that have been selected.
, ListBoxItem. ( , seletecteditems ). , ( , , , , ).
:
foreach (Object listBoxItem in listBoxObject.SelectedItems)
{
}
, , foreach. (: , ). - .
foreach (String listBoxItem in listBoxObject.SelectedItems)
{
}