Remove the selected items in a ListBox

This is how to remove all selected items from a listbox

Just do: Call ListBoxRemSel List1

replace List1 with the name of your listbox..

Sub ListBoxRemSel(lst As ListBox)
    Do Until lst.SelCount = 0
        If lst.Selected(a) Then lst.RemoveItem a: a = a - 1
        a = a + 1
    Loop
End Sub

You might also like...

Comments

Kym Manson Till the Roof comes off Till the Lights go out Till my Legs give out Can't shut my mouth I will not fall, my Wisdoms all.

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” - Tom Cargill