Sure, but a _collection_ doesn't support that property. Items.Count
gets the number of items. I've looked high and low for an answer to
this question, and it doesn't seem to be answered anywhere. And "last
item" can be a bit obscure. There is a subcollection called
SelectedItems/Indices, but the item with focus does not necessarily
have to be in this collection. For example one can select a range of
items, then deselect one of them. The deselected one will have focus,
but won't be selected.
This is a tough nut!
- Peder -
"clintonG" <csgallagher@RE************@metromilwaukee.com> wrote in message news:<uE*************@TK2MSFTNGP11.phx.gbl>...
A quick thought -- if we can query the control to get the value of the
number of items in the ListBox we can get the value of the last item
in its collection. That should be in the documentation.
--
<%= Clinton Gallagher
A/E/C Consulting, Web Design, e-Commerce Software Development
Wauwatosa, Milwaukee County, Wisconsin USA
NET csgallagher@ REMOVETHISTEXT metromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/
"Peder Y" <py*****@ec.auckland.ac.nz> wrote in message
news:10**************************@posting.google.c om... Anyone knows if there is some kind of property or function that will
return the last selected/deselected item/index in a multiselect
ListBox? SelectedIndex will point to first index in the
SelectedIndices collection, so this is a dead end. My solution so far
is to override the mouse click and key pressed events. However, since
arrow up/down seems to keep a record of the item that currently has
focus somehow, I would believe this information is stored somewhere.
Any help is appreciated since I can't seem to figure this out without
tending to overkill solutions.
- Peder -