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:
00425406
Views:
12
>>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.

Yeah, that helped. I am trying to give users the option to either use the keyboard or mouse.
"Build a man a fire, and he's warm for a day.
Set a man on fire, and he's warm for the rest of his life."
Previous
Reply
Map
View

Click here to load this message in the networking platform