Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
'on key' events seem to have priority over valid method.
Message
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00582463
Message ID:
00582723
Views:
24
>In our application, we use pageframes to accomodate large data entry tasks. To accomodate our customers that don't like mouse-interupts, we have a page-up and page-down utility that is called using the ON KEY PGUP and ON KEY PGDN commands.
>
>This has worked fine, but I have recently discovered some really strange behavior that is new to me (but apparently existing all along). It seems that if we are on an object that has a valid (lostfocus, etc.) method, and press the Page Up key, then the object methods are not executed until the page is loaded the next time.
>
>In our case, this causes program errors to occur when the valid is 'restarted' upon page activate, due to now-incorrect dynamic form properties. It is also causing data to be stored incorrectly for some items, such as measurement conversions.
>
>Is there a standard way to handle this, or does anyone have any ideas how to ensure that the object valid property gets executed prior to leaving a page?
>
>Thanks in advance,
>
>David

You could try using the THISFORM.activecontrol property to call the lostfocus and valid events of the object, in the code called by the ON KEY command. For example:

thisform.activecontrol.lostfocus()
thisform.activecontrol.valid()

Good Luck,

Gerry
Previous
Reply
Map
View

Click here to load this message in the networking platform