multi-select list box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a multi-select list box on one of my forms.

What i would like to have is a 'select all' button which will automatically
select everything in the box.

Can any suggest a way of doing it?

Thank you

Nick
 
In the click event of the button, put the following code assuming your
listbox is called lstTest

Dim i As Integer

For i = 0 To lstTest.ListCount - 1
lstTest.Selected(i) = True
Next i
 
Perfect!

Thank you very much.

Nick

Dennis said:
In the click event of the button, put the following code assuming your
listbox is called lstTest

Dim i As Integer

For i = 0 To lstTest.ListCount - 1
lstTest.Selected(i) = True
Next i
 
Back
Top