my application have ListView and inside my foreach loop i am add files into my ListView and want the option to show the current file as marked, before using ListView i try ListBox and used SetSelected successfully.
i try listView.Items[listView.Items.Count - 1].Selected = true; nut this marked all the files inside my ListView
Make sure you are setting the selection outside the loop. if you do it in the loop, you will see that all items are selected because the listview item count is increasing as you add items to the listview: