Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Not Necessary but would be nice
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00139787
Message ID:
00140557
Views:
28
Yes, of course that would work. It just wouldn't be very intuitive in a calculator context. You could add a trap for the +,-,/,*,= keys and parse that to the alpha equivalent label on the button perhaps, but you would still need an alpha based shortcut key to appear on the button, ie: caption='+ \Caption = " + \<A". Another problem comes into play when using the '=' character. VFP uses '=' to indicate the value is to be evaluated, so you need to use:
Caption = "  " + chr(61) + "          \<E"
.

>Hi Ken,
>
>>One caveat using this approch: It will not work for the operator keys (+,-,/,*,=). ALT key combinations on these keys are not valid.
>>
>>>Just to clarify for those who don't want to wade through the code... The command buttons in this sample are using shortcut keys \<1,\<2,\<3, etc. This is what the reference to the ALT key meant. In the textbox, I trap for a range of keys (0-9) and issue a keyboard('{ALT+' + chr(nKeyCode)+'}') to add the ALT key to the keypress, and thus activate the button. There's a few other issues, but this message was just to convey the general idea.
>
>Run the following code and press ALT+A (like Add *s*):
>
>Public oForm
>oForm = Create("frmTest")
>oForm.Show
>
>Define Class frmTest as Form
>   Add Object Command1 As Commandbutton With ;
>      Height = 25, ;
>      Width = 25, ;
>      Caption = "  +   \<A"
>Enddefine
>Christof
kenweber
GCom2 Solutions
Microsoft Certified Professional

Previous
Reply
Map
View

Click here to load this message in the networking platform