ListView double click

Trips

Well-known member
Joined
Aug 7, 2010
Messages
2,788
Hi, Im having some trouble with a listviews double-click event. I want action A to take place if I double-click an item in the listview and action B if I double-click an empty area of the listview. Ive tried the following in the double-click event:
if (listView1.SelectedItems.Count == 0)<br/>
MessageBox.Show("Action B");<br/>
else<br/>
MessageBox.Show("Action A");
But it doesnt work, any suggestions?
Edit: Action A never takes place, only action B does.
Edit 2: I made a mistake, sorry. Actualy, its action B that never takes place. It seems like the double-click event is for double-clicking items, not applying to the empty area of the listview.

View the full article
 
Back
Top