Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
STATE OF LISTBOX
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00423768
Message ID:
00424374
Views:
21
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform