[RESOLVED] [2005] ListView double click help
Hi Everyone,
I have a ListView box that I am populating from a query against my machine. I would like to be able to double click the data in the box and have a popup box display the text I double clicked.
For example,
If the ListView is displaying the word "hard drive", I would like to be able to double click "hard drive" and have a message box pop up displaying the text "hard drive".
I have tried using the below code, but it is not correct.
Code:
MsgBox(lvLocalDisk.SelectedItems.ToString)
NOTE: lvLocalDisk is the name of my ListView box.
When I double click the intended item, using the above code, I get the message box "System.Windows.Forms.ListView+SelectedListViewItemCollection"
Can anyone help me with my problem? Thanks!
Re: [2005] ListView double click help
That is because of this:
vb.net Code:
Public ReadOnly Property SelectedItems() As System.Windows.Forms.ListView.SelectedListViewItemCollection
So instead use:
vb.net Code:
MessageBox.Show(Me, lvLocalDisk.SelectedItems(0).ToString)
That was freehand so tweaking my be needed.
Re: [2005] ListView double click help
Hey Troy,
Thank you for explaining that. Your suggestion worked perfectly. Thank you!