|
-
Nov 26th, 2011, 04:53 AM
#1
Thread Starter
Lively Member
[RESOLVED] Deleting selecte items in ListBox
Hello guys, I have this frustrating problem, I have 3 list box, 1st is for itemName, 2nd is for Quantity, and 3rd is for Price.. How can I Delete the itemName in the listbox and at the same delete the price and quantity. All I can do is to delete a single selected ItemName, but I can't delete the price and quantity. here's my code
Code:
Private Sub btnDelete_Click()
Call ListBoxRemSel(lstItem)
End Sub
Sub ListBoxRemSel(lst As ListBox)
Dim a As Integer
Do Until lst.SelCount = 0
If lst.Selected(a) Then lst.RemoveItem a: a = a - 1
a = a + 1
Loop
End Sub
-
Nov 26th, 2011, 06:28 AM
#2
Re: Deleting selecte items in ListBox
Use the following code:
vb Code:
Sub ListBoxRemSel(lst1 As ListBox, lst2 As ListBox, lst3 As ListBox) Dim j As Integer For j = lst1.ListCount - 1 To 0 Step -1 If lst1.Selected(j) = True Then lst1.RemoveItem j lst2.RemoveItem j lst3.RemoveItem j End If Next End Sub
-
Nov 26th, 2011, 07:10 AM
#3
Thread Starter
Lively Member
Re: Deleting selecte items in ListBox
Tags for this Thread
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
|