How tell if multi-select listbox row is selected?

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.
 
G

Graham Mandeno

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.
 

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