Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Editbox with keypress event doesn't work properly
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01347649
Message ID:
01348636
Views:
15
>Yes, my form class has a custom KeyPress method and has KeyPreview set to .T.
>
>However, the form's KeyPress is meant to catch certain control key combinations that make things happen on the form. If the key pressed is not one of those special control keys, processing is (or should be) passed on to the control, in this case, the editbox.
>
>I have some code that creates an ultra-simple form from my formclass, puts a PageFrame with two pages on the form, and puts an editbox (using my custom editbox class) on the form. This form works. The enter key works fine and the function key combinations caught by the custom editbox KeyPress event also work. However, when I run a real form in my application, with the custom editbox on a pageframe on a custom form, it doesn't work. As I said before, I'm sure there must be some interaction with other controls or something that's screwing things up. I just haven't figured out what it is, and I'm running out of ideas.
>
>If I go to the real form, type something, and press enter, the cursor goes to the next line. But when I start typing again, the characters appear on the previous line. But strangely, if I use one of the function keys (F5, F6, and F7 simply insert character strings defined by the user and stored in a table), the correct character string is inserted, and after that the Enter key works correctly.
>
>- Jen

That may be not a good solution, but in cases like this I used these two approaches:

1. Start a new form and incrementally add functionality from not working form till the culprit is found

2. Start removing code/objects from the form until the culprit is found.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform