>How can on key label command be used in forms ? When I write following commands in Load event of the form :
>on key label Ctrl+A thisform.pageframe1.page1.command1.click() ;
>an error message "Thisform can only be used within a method" appears.
There is a simple rule to remember when using On Key Label with forms:
Don't ever do it.
To perform an action in a form when a user presses a certain key combination, intercept the key in the form.KeyPress event.
Form.KeyPress()
LPARA nKeyCode, nShiftAltCtrl
IF nKeyCode = ASC('A') and nShiftAltCtrl = 2
NODEFAULT
thisform.pageframe1.page1.command1.click()
ENDIF
For this code to work form-wide, the form KeyPreview property must be set to .T.
hth
Erik Moore
Clientelligence