Listbox ItemsSelected Property

G

Guest

Does the ItemsSelected property not work if the listbox multi-select is set
to none?

I've been working my way through a problem, off and on for a couple of days.
What I wanted to do was enable/disable a command button based on whether an
item was selected in the listbox where multi-select is set to None.

I was using code similiar to the following in the listboxes Click event, but
nothing was happening.

Private sub myList_Click

me.cmd_myCmd.enabled = (me.mylist.ItemsSelected.count > 0)

end sub

I was finally able to get the effect I wanted with the following code:

Private sub myList_Click

me.cmd_myCmd.enabled = (me.mylist.listindex > -1)

end sub

Comments?
 

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

Top