Listbox ItemsSelected Property

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
Back
Top