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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top