Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
F10 key press in text box - not valid
Message
From
11/03/1999 20:37:31
 
 
To
11/03/1999 19:59:47
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00196597
Message ID:
00196607
Views:
32
Hi Gaylen ---

Nice to see another TFUG member here :-)

Anyway, you have to rout ON KEY LABELS to procedure code and do what you want there. For example, I usually have a procedure file called "hooks" where I store code to run. You want to turn the OKL on and off in the focus events of a control to make sure that it works as expected in a modeless environment. What does this all mean? Welll....here's the breakdown:


*** Form.TextBox.GotFocus
ON KEY LABEL F5 DO recalc IN hooks

*** hooks.prg
PROCEDURE recalc
_SCREEN.ActiveForm.cmdRecalc.Click()
ENDPROC

*** Form.TextBox.LostFocus
ON KEY LABEL F5

Got it?

>I need to read the F10 keypress in a text box. I put code in the keypress method and it will read all the key pressed except the F10 key . Any thoughts on how to read the keypress. Client wants to use F10 for consistency sake so I can't substitute another key.
>
>I tried to use the on key label F10 however, when I press the F10 key an error message comes up and states that it doesn't recognize thisform. The code for the key label is as follows:
>
> ON KEY LABEL f10 thisform.cmdrecalc.click()
>
>
>I would prefer to use the F10 keypress event. Any thought on how to do this or why the on key label gives an error message would be greatly appreciated.
>
>Thanks
>Gaylen Jungling
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Reply
Map
View

Click here to load this message in the networking platform