General information
Category:
Coding, syntax & commands
>>pressing F2 = append new record
>> F4 = delete record
>> F5 = skip back
>> F6 = skip forward
>> F7 = goto bottom
>> F8 = goto top
>>etc. ...
>Marc,
>
>I would suggest that you NOT use ON KEY LABEL as those are intercommand interrupts and they could fire during other code running and cause major problems. I would suggest the following as a way of doing what you want.
>
>Use the keypress event of your formclass a=with KeyPreview set to .T. In the keypress event you can check for the keycodes (ascii numbers) for the keys you want trapped, issue a NODEFAULT and then call teh appropriate method of the form to do the work.
>
> * Form KeyPress
> LPARAMETERS nKeyCode, nShiftAltCtrl
> DO CASE
> CASE nKeyCode = -1 && F2
> NODEFAULT
> THISFORM.AddNew()
> CASE nKeyCode = -3 && F4
> NODEFAULT
> THISFORM.DelRec()
> CASE nKeyCode = -4 && F5
> NODEFAULT
> THISFORM.GoPrevious()
> CASE nKeyCode = -5 && F6
> NODEFAULT
> THISFORM.GoNext()
> CASE nKeyCode = -6 && F7
> NODEFAULT
> THISFORM.GoBottom()
> CASE nKeyCode = -7 && F8
> NODEFAULT
> THISFORM.GoTop()
> ENDCASE
Hi Jim,
Sorry for the late reply, been a bit busy lately :)
Your tip is coming the most near what i am loking for, i think.
After giving it a try (exactly your code) the result was zip-nothing---> a crash from the program
Am i missing something ??
Did i left something out ??
Marc
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only