Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Keypress event
Message
 
To
15/07/2000 21:25:52
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00392129
Message ID:
00393041
Views:
17
>
>Please describe the exact behavior you want to see.
>
>Thanks,
>
>Dave
>

>

>>I have some code I want to run in the keypress event of a textbox. In the event code I have a dodefault() but it doesn't appear to update the value property of the control with the key that was pressed to get into the event code.
>>
>>When does the value of the key that was pressed get added to the value property of the control?


What I was trying to do was create an autocomplete textbox that used a database for lookup values. A combobox wasn't really appropriate because it was not a validated field. The textbox was both a tool to find records as well as a data entry field. I solved my problem by using the nkeycode parameter, adding it to the current value property of the control in order to get the string I needed to search for in the database.

I still wonder however, if you always have to use syntax like:

this.value+chr(nKeyCode)

in the keypress event of a textbox in order to get the current value of the control.

It seems you should be able to issue a dodefault() and then just reference the value property of the control. But issueing a dodefault() seems to duplicate the last key pressed in the value property.


In anycase I got what I was after.
Rip Ryness
International Falls, MN
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform