How tell if multi-select listbox row is selected?

  • Thread starter Thread starter mscertified
  • Start date Start date
M

mscertified

In a multi-select listbox, how can I detect if the user is clicking on an
already selected row? I need to take some action if the row is being selected
but not if it is being unselected.

Thanks.
 
Hi mscertified (Rupert?)

In your listbox's Click event, lstName.ListIndex gives the index of the row
that is being clicked (zero-based).

lstName.Selected( Index ) gives the selected status (true or false) of any
row.

Therefore, lstName.Selected(lstName.ListIndex) will return True if the
current row is being selected, or False if it is being unselected.
 
Back
Top