Results 1 to 8 of 8

Thread: ListView ItemDoubleClick

  1. #1
    Guest

    Talking

    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.

  2. #2
    Fanatic Member RealisticGraphics's Avatar
    Join Date
    Jul 1999
    Location
    Arkansas
    Posts
    655

    Wink

    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

  3. #3
    Guest

    Talking Not quite

    It does track double clicks, but on the entire control, i meant on a specific item in the control.

  4. #4
    Fanatic Member RealisticGraphics's Avatar
    Join Date
    Jul 1999
    Location
    Arkansas
    Posts
    655

    Thumbs up

    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

  5. #5
    Guest

    Thumbs down 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.

  6. #6
    Fanatic Member RealisticGraphics's Avatar
    Join Date
    Jul 1999
    Location
    Arkansas
    Posts
    655
    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

  7. #7
    Guest

    Talking

    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.

  8. #8
    Guest

    Talking 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
  •  



Click Here to Expand Forum to Full Width