Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP5: On Key Label
Message
From
01/05/1997 16:44:45
 
 
To
01/05/1997 16:30:42
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00030535
Message ID:
00030541
Views:
40
>>>>Hi All,
>>>>
>>>>I tried to use On Key Label command to reset the control focus. Here is the command I used in the Init Method:
>>>>
>>>>ON KEY LABEL frmMyForm.txtField.setfocus()
>>>>
>>>>I got an error saying "frmMyForm is not an object". Did I miss anything?
>>>
>>>If you are already in frmMyForm you should use reference 'Thisform'.
>>>Thisform.txtField.setfocus()
>>>BTW, it's better to use KeyPress event than ON KEY LABEL.
>>
>>I tried to use ON KEY LABEL thisform.txtField.setfocus(). But it gave me an error "THISFORM can not be used within a method". Any idea why?
>>
>>BTW, KeyPress can not be used for any combination of keys with the Alt key.
>
>Firstly, ON KEY LABEL should look like:
>ON KEY LABEL RIGHTARROW do something
>That's right that in external procedure 'something' you must use real reference frmMyform, but to get it understandable for VFP you must use NAME clause of DO FORM command when you start the form. You see: alot of troubles, so it's better to use KeyPress using Non-Alt keys for user interaction. All this stuff (press Alt-10 and so on) going from old Foxbase and now it's good time to throw it out.

It's really written in Help that Keypress doesn't react on Alt-keys, but I just tested and it works Ok. One more time when MS cares?
Edward Pikman
Independent Consultant
Previous
Reply
Map
View

Click here to load this message in the networking platform