Is there a way to track double-clicks on items in a listview control? there is an ItemClick event, but it doesn't seem to track double-clicks. :(
Printable View
Is there a way to track double-clicks on items in a listview control? there is an ItemClick event, but it doesn't seem to track double-clicks. :(
Of course there is, it is listed just like the other double click events (DblClick)
It does track double clicks, but on the entire control, i meant on a specific item in the control. :(
You have to use the DblClick event and capture what item was clicked on. To test the code below add a listview to a form and set it to Report View.
If that is not what you want, please let me know.Code:Private Sub Form_Load()
ListView1.ColumnHeaders.Add , "testing", "testing"
For i = 1 To 10
Set pkey = ListView1.ListItems.Add(, "test" & i, "test" & i)
Next
End Sub
Private Sub ListView1_DblClick()
Set pkey = ListView1.SelectedItem
MsgBox pkey
End Sub
That doesn't work either.
If there's an item selected, and the user double-clicks a blank spot on the control, it still MsgBox's me the name of the selected item.
That wouldn't work.
:(
Hmmm... Not sure how to get around that. You can set the listview to full row select and then there is not a blank area. What exactly are you doing that would need it not to give you the last selected item if you click in a blank space? If you're only using one column you could try a listbox instead. But you loose some functionality.
I'm working on a file manager\manipulation program so i need a good file browser ;)
I have about four columns: Filename, Size, Type, and Last Modified.
FullRowSelect is a pretty good idea, even though i don't like it much. :(
I also give an option for Icon view, so FullRowSelect won't do the job.
Thanks for your time anyway.