|
-
Oct 20th, 2001, 12:34 PM
#1
Thread Starter
Fanatic Member
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.
-
Oct 20th, 2001, 12:46 PM
#2
Fanatic Member
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
-
Oct 20th, 2001, 12:52 PM
#3
Hyperactive Member
Private Sub ListView1_Click()
if Listview1.SelectedItem.Image="XImage" then Delete
end sub
-
Oct 20th, 2001, 01:37 PM
#4
Thread Starter
Fanatic Member
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.
-
Oct 20th, 2001, 02:01 PM
#5
Hyperactive Member
Sorry, forgot that Listviews use Icons, not bitmaps
Private Sub Listview1_Click()
If Listview1.SelectedItem.Icon = ImageList1.ListImages("XImg").ExtractIcon Then Delete
End Sub
-
Oct 20th, 2001, 03:19 PM
#6
Thread Starter
Fanatic Member
Thank you Ed Lampman. With a little bit of tweaking I got the code to work okay. Thanks again.
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
|