Extended Multi Select List Box and Keyboard navigation

H

Hakan Naslund

Hi!

I have a listbox configured as Extended Multi Select.

On the After Update Event, I have this code:
Private Sub List0_AfterUpdate()
For Each itm In List0.ItemsSelected
Debug.Print List0.ItemData(itm)
Next itm
End Sub

If I use the mouse to select records (just single records, no ctrl or
shift!), the
debug.print return the correct row and data.

BUT if I use the keyboard arrow keys to move up/down in the listbox,
the debug.print will show the values of the row that was active before the
up/down move!

Let's say my list box shows the following rows:
Andrew
Burt
Charlie
Derek

A mouseclick on Burt will debug.print '1 Burt'
A mouseclick on Charlie will debug.print '2 Charlie'

If I now use the keyboard's down key to move to Derek, it will still print
'2 Charlie' !
And if I press the up key and move back to Charlie, it prints '3 Derek'.

So when using the keyboard I'm always one step behind what's actually
marked...

Any ideas?

Hakan Naslund
Sweden
 

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