Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

F2 keypress

Status
Not open for further replies.

ronald777

IS-IT--Management
Jun 25, 2003
26
NL
I have a problem with using the function key F2 in the keypress event. F3 to F12 is working normally.

the keypress event is not trapping this key F2, execpt when i go first in debugging mode.

i can use instead ON KEY LABEL F2 but this command i can only use outside the form.

So i can first start a program .PRG with the "on key label F2 _screen.activeform.method" command and then the form instantiation, but i dont like it very much.

Is there another way, u know maybe?


 
What is the code you are using to trap the F2 key?

David W. Grewe Dave
 
In the keypress Event of the form:

if nKeyCode = -1 && F2 key pressed
do code
endif

but doesnt matter for me bcos the keypress-event is not triggered when pressing F2 key (except when u go in debug mode)
 
Same code I use, OK
1. Make sure your F2 key is not mapped to another function 2. Mapped to a macro expresion.
3. No other On KEY LABEL F2 is used.
4. Just prior to where you expect the F2 key to be used add
ON KEY LABEL F2 (like in the Get Focus of a control)

If these ideas do not help We'll try others.


David W. Grewe Dave
 
Thanks David for u cooperative thinking, i have a blackout i think :)

i can issue the command "on key label f2 _screen.activeform.method" also in a form method instead of a external program.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top