I try to do somthing when the user select item in the ListView. I have tried this code:
private void listView1_SelectedIndexChanged(object sender, EventArgs e) { q = listView1.SelectedItems[0].Index; }
but it doesn't work and throws an exception that says that the count of 'listView1.SelectedItems' is 0.
Why doesn't it work?
SelectedItems.Count>0
– TaWSelectedItems.Any();
– Mafii