Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Firing a method from an OKL?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00127489
Message ID:
00127543
Views:
19
>Is there a way to execute a method of a control from an OKL, where the OKL is defined in the init of the form which contains the control? I want to run the Click() method of a button (which has no text prompt, just a graphic) by pressing a key sequence, like Ctrl-F. I have the following in the form's Init...
>
>ON KEY LABEL CTRL+F ThisForm.cmdFind.Click()
>
>... but I get the error "THISFORM can only be used within a method".
>
>Is there a way to do this???

mark,

Dump the OKL and use the form's Keypress evetn instead. SEt Keypreview to .Tl. and in the Keypress do this;
IF nKeyCode = 6 &&Ctrl+F
   * Stop the processing of the key stroke
   NODEFAULT
   * Call the button's click event code
   THISFORM.CmdFind.Click()
ENDIF
Previous
Reply
Map
View

Click here to load this message in the networking platform