|
-
Jul 6th, 2000, 05:13 PM
#1
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.
-
Jul 6th, 2000, 05:19 PM
#2
Fanatic Member
Of course there is, it is listed just like the other double click events (DblClick)
www.RealisticGraphics.net
Running VS.Net Enterprise & VB 6
Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML
MSN Messenger: kmsheff
-
Jul 6th, 2000, 05:25 PM
#3
Not quite
It does track double clicks, but on the entire control, i meant on a specific item in the control.
-
Jul 6th, 2000, 06:32 PM
#4
Fanatic Member
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.
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
If that is not what you want, please let me know.
www.RealisticGraphics.net
Running VS.Net Enterprise & VB 6
Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML
MSN Messenger: kmsheff
-
Jul 6th, 2000, 06:40 PM
#5
Nope
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.
-
Jul 6th, 2000, 06:54 PM
#6
Fanatic Member
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.
www.RealisticGraphics.net
Running VS.Net Enterprise & VB 6
Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML
MSN Messenger: kmsheff
-
Jul 6th, 2000, 07:03 PM
#7
-
Jul 6th, 2000, 07:17 PM
#8
Another Thing
I also give an option for Icon view, so FullRowSelect won't do the job.
Thanks for your time anyway.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|