An alternative you might consider is to assign F4 as a shortcut key for a menu command. The command would look something like this:
_vfp.ActiveForm.SomeMethod()
>Hi.
>I want to set a screen level On Key label, so that the user can hit a Function key to carry out a particular option.
>I have code in the init like:
>On Key Lablel F4 Thisform.MyMethod and I have a Method as:
>
>** MyMethod ****
>Take Some Action
>
>(Note that MyMethod is also called from other controls within the form)
>
>I get a Thisform can only be used within a Method.
>
>Anybody got a solution for this ?
>regards,
>Gerard
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)