> Doesn't the down arrow already move the selection down in any list box
> if it is selected? You should only have to set the tab order of the
> form how you want it. Then when the user tabs to the list box they can
> use the down arrow. To select the highlighted selection in the list
> box you can push the space bar. Thoughts?
You're right... the down arrow moves the selected row down (changes
ListIndex) in the listbox if the listbox is selected. But in my case,
the listbox isn't selected... a textbox is. And I want to leave the
textbox selected but have the down arrow change the ListItem property
for the listbox. The event handler I wrote for the textbox_keydown event
did that, but after the listbox was changed the focus moved from the
textbox to the next control on the form. I assume that what happened was
that after I processed the keycode, something in the system processed it
too, and moved the focus. By setting the keycode to 0 after I processed
it, the downstream handler apparently ignored it and I got the behavior
I wanted.
I can explain in more detail if you want it, but setting the keycode
seems to be the solution.
Thanks for the responses...