I need to remove more than one item from a list box...
here is the code
ignore the comments, those were pieces of code I thoought about using..Code:Private Sub Command1_Click() ff = FreeFile Open "c:\windows\desktop\list\list.txt" For Input As #ff Do Until EOF(ff) Input #ff, this List1.AddItem (this) Loop Close #ff End Sub Private Sub Command2_Click() 'On Error GoTo that 'List1.RemoveItem List1.ListIndex 'Exit Sub If List1.SelCount > 1 Then Do Until List1.SelCount = 0 List1.RemoveItem List1.ListIndex Loop ElseIf List1.SelCount = 1 Then List1.RemoveItem List1.ListIndex ElseIf List1.SelCount = 0 Then Exit Sub End If 'that: MsgBox (Err.Description) End Sub
this code works fine and dandy for removeing single items, and removing items that are right next to eachother, but if there is an item in between two selected items, it gets deleted also, please help me.
thank you
Dennis Wrenn




Reply With Quote