Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to set function key in form designer?
Message
From
03/08/1999 22:37:43
 
 
To
03/08/1999 21:33:25
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00249549
Message ID:
00249561
Views:
19
>I like to use form designer to create project as I do not have to write lengthy prg files. To set a function key for simple action(e.g. REPORT FORM.. to PRINTER) I include ON KEY LABEL... in the LOAD event in the form. As it is not allowed to include PROCEDURE file in LOAD event there must be some ways to accomplish it. I wonder if anybody could teach me how to do!



At Form Designer, change the Form property "KeyPreview" to .T.

At Form.KeyPress() Event, add you coding:
Lparameters nKeyCode, nShiftAltCtrl
Do case
case nKeyCode = -2 && F3 
    do form PopupForm

case nKeyCode = -7 && F8
    Thisform.CmdPrint.Click

endcase
To find out the Keypress Value, you can see the list in Help on InKey( )
But I suggest you make a test form to show what is the value on keypress as nKeyCode!
Why? there are some key give different value on development time and run time!!!!!
e.g. Shift+Tab in develop time is -400, 1 whereas the run time value is 15, 1 !!
You need to consider both cases to ensure it work the same in both develop time and run time!

Although you can add a short cut to make the print more fast,
you're better to give a normal way to do!

Otherwise, your user manual should write completely for new user to follow!

^_~ Good Luck
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform