|
-
Mar 26th, 2002, 02:39 PM
#1
Thread Starter
Addicted Member
Removing Items From List View Box
How can I remove the item I double click in a listview box ?
-
Mar 26th, 2002, 03:05 PM
#2
Frenzied Member
i think without testing it
listview.listItem(listview.selectedItem.index).Remove
-
Mar 26th, 2002, 03:13 PM
#3
VB Code:
Private Sub ListView1_DblClick()
On Error Resume Next
Dim i As Long
For i = 1 To ListView1.ListItems.Count
If ListView1.ListItems(i).Selected = True Then
ListView1.ListItems.Remove i
End If
Next
End Sub
-
Mar 26th, 2002, 03:21 PM
#4
Frenzied Member
sorry i was close
lst.ListItems.Remove lst.SelectedItem.Index
hack would you really loop thru 1000 item each time!!!
if you want to make sure it's not empty
if not lst.lisitems.count then lst.ListItems.Remove lst.SelectedItem.Index
-
Mar 26th, 2002, 03:33 PM
#5
Ooh...good point sebs
I use that code, generally from a command button, when the user has selected multiple items. I just cut 'n pasted it into a double click event. Brain fart on my part!
nmretd: Use sebs code instead!
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
|