ListBox Item Row Number

L

Laurence Lombard

Is there an easy way to find the sourcelist row number of a listbox
item. Something like Rownumber = ListBox1.Row

One way would be to have a helper column with all the row numbers and
use that column as the BoundColumn, but I was wondering if there was
something more direct

Thanks
Laurence
 
G

GS

Laurence Lombard formulated the question :
Is there an easy way to find the sourcelist row number of a listbox item.
Something like Rownumber = ListBox1.Row

One way would be to have a helper column with all the row numbers and use
that column as the BoundColumn, but I was wondering if there was something
more direct

Thanks
Laurence

Listbox uses the ListIndex property for the position of a selected
item. Note that this is zero-based and so...

RowNumber = ListBox1.ListIndex + 1

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
 

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