|
-
Jun 3rd, 2007, 01:09 PM
#1
Thread Starter
Addicted Member
[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!
-
Jun 3rd, 2007, 01:23 PM
#2
Hyperactive Member
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.
Prefix has no suffix, but suffix has a prefix.
-
Jun 3rd, 2007, 01:36 PM
#3
Thread Starter
Addicted Member
Re: [2005] ListView double click help
Hey Troy,
Thank you for explaining that. Your suggestion worked perfectly. Thank you!
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
|