We need you!

We're working hard on the next version of Developer Fusion. Let us know what you think we should be up to!

Members

Technology Zones

Articles

Hosted By

MaximumASP

Info

Rated
Read 27,691 times

Related Categories

Remove the selected items in a ListBox

Kimmy

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

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.

Comments

  • ...

    Posted by Steele on 22 Nov 2001

    you forgot to add "Dim a as integer" otherwise the code wont work

    Sub ListBoxRemSel(lst As ListBox)
    [b]Dim a as integer[/b]
    Do Until lst.SelCount = 0
    If lst.Selected(a) Then lst...