There is a DblClick event for ListView control, but there is not DblClick event for it's ListItem. How can I define that DblClick event occures exactly when I make double click on ListItem and not on blank space of control?
upper = lsv.ListItems.Count 'lsv is the name of the listview control
'The code below finds the selected item
'loops through each of the items till it finds a selected item, then the code in the if statement is executed..
For i = 1 To upper
If lsv.ListItems(i).Selected = True Then
'place code here that needs to be processed when an item is double clicked
Exit For
End If
Next i
But I DO NOT want to use the selected item!
OK, this is the code I use:
1. In the General section
Private lst As ListItem
2. In the MouseMove event
Set lst = lv.HitTest(x , y)'lv - the ListView control
3. In The DoubleClick event
If Not lst is Nothing Then
'My code here
End If
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.