How to select an Item in a Listview
Visual Basic
2
Posts
2
Posters
0
Views
1
Watching
-
I have a listview in details mode, and I want to be able to double click on it and a varaiable return with the information that I click on. Is this possible? Thanks in advance Code_Gopher
-
I have a listview in details mode, and I want to be able to double click on it and a varaiable return with the information that I click on. Is this possible? Thanks in advance Code_Gopher
Would something like this work? (Assuming a control on the form called ListView1)
Private Sub ListView1\_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) \_ Handles ListView1.DoubleClick '-- get the item selected following the double-click Dim sel As ListViewItem sel = ListView1.SelectedItems(0) '-- display the selected item text If Not (sel Is Nothing) Then MessageBox.Show(sel.Text) End If End Sub