-
ListView
Hi Everyone,
Inside of a ListView I have two different kinds of icons displayed in the first column. what I would like to do is this. When the user selects an item from the list I would like to run a procedure that corresponds to the icon in the row that was selected. So, for example, if the user selected a row in which there was an 'X' icon displayed, the item in that row would be deleted. If the user selected a row in which there was a 'Y' icon displayed Then nothing would happen. Does anyone have any ideas on how to accomplish this? I would appreciate any help. Thanks.
-
why don't u add a key to each listview row the key will correspond to each image
so if a user clicks a x image key xImg--> x will know it
-
Private Sub ListView1_Click()
if Listview1.SelectedItem.Image="XImage" then Delete
end sub
-
can you provide an example of using the ListView Key. I am not familiar with using this. Also the image is coming from an image list, so I would have to associate the image on the row with the key. Can all of this be done? Please help if you can. Thanks.
-
Sorry, forgot that Listviews use Icons, not bitmaps
Private Sub Listview1_Click()
If Listview1.SelectedItem.Icon = ImageList1.ListImages("XImg").ExtractIcon Then Delete
End Sub
-
Thank you Ed Lampman. With a little bit of tweaking I got the code to work okay. Thanks again.