>I've been playing with this on my form and the .ListIndex = 1 seemed to work somewhat BUT A STRANGE THING.. In the textbox 'keypress event' I have:
>if nkeycode=24
>*KEYBOARD '{TAB}'
>thisform.mylistbox1.setfocus()
>thisform.MYlistbox1.ListIndex = 1
>endi
>If I hit the downarrow{24} the listbox gets the focus with the 1st item highlighted but as soon as an arrowkey is stroked, the focus moves on to another item. BUT if I hit ENTER{23} ,the listbox gets the focus with the 1st item highlighted AND I can keep on scrolling with the arrows. This is the correct behavior but I want it initiated with the down arrow. :(
Try adding NODEFAULT to your KeyPress event code. Any time you intercept a keypress and do your own thing with it you typically want to suppress the default behavior of that keypress, which is what NODEFAULT does.
Rick Borup, MCSD
recursion (rE-kur'-shun) n.
see recursion.