Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Refreshing objects
Message
From
04/06/1999 03:37:00
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
02/06/1999 14:55:14
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00224632
Message ID:
00226379
Views:
23
>>>Is there a reason that you want to use a User Defined Function
>>>instead of an object?
>
>Not a special reason, but how can I put some action to "F5"-key, so the user could get this function directly from keyboard and not just by clicking to the object with mouse? Is there a way to put the key label (F5) as a shortcut to the object (button, for example)?

There's one OOP way to do it - to set the KeyPreview property of the form to .t., and catch the keypress of F5 in form.keypress method (I think the nKeyCode should be -4, but better check help for InKey() function).

The trouble with OKL in OOP is that they run almost independently from the form which they were called from, and you can't use any of the ThisForm and other code which can go into methods only; furthermore, you may have to look for the active form to know where is your code called from, etc etc - lots of overhead for a doubtful gain. Another trouble is that you have to take care to remove your OKL when you deactivate the form, because another form may be active when you press F5, and then set the OKL again when you activate it again.

General trouble is that keyboard buffer will always be faster than Fox. Try to keep F5 pressed for five seconds when you have an OKL on F5. Issuing "Set typeahead to 0" in the first line of the OKL routine didn't help in FP2.0, didn't help in 2.6, and I doubt it would help now.

HTH

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform