Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
On key label triggers button click
Message
From
28/10/2002 20:11:54
 
 
To
27/10/2002 19:00:30
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00715908
Message ID:
00716282
Views:
19
Dragan,

Thanks for your reply.
What I am doing is part of converting a DOS time recording app to Windows.
The ON KEY LABEL applies to the F1/F2/F3/F10 keys which I cannot change because of the large number of employees (> 10000) who would be dumbfounded if I did!

The on key assignments only and specifically refer to one form (out of a total of 3), and as I mentioned, does properly trigger the click events of the associated buttons.

What I am trying to acheive is to get the buttons to visually depress and come back up as they would if they were clicked on (The mouse will not be available to the employees!).

It's not crucial to do this, but would be nice.

Regards

>>Hi,
>>
>>I have a form with a command button whose click event is also triggered by ON KEY LABEL F2.
>>The event does fire. However, I would like the visual button click to show.
>>How can I do this?
>
>First, avoid On Key Label. There are other ways. The reason for this is that OKL runs out-of-context; it doesn't know the name of your form, has no sure way to reference it etc etc. Even if you made it run a .prg file, that file would need to find your form first - probably by traversing _screen.forms collection and looking for a button with a given caption, name or some other distinguishable property.
>
>Two safer ways would be to either have a (optionally hidden) menu on the form which would have a hotkey for F2, or to have form.KeyPreview=.t., and to capture the case where nKeyCode=-1 (AFAIK, that's the code for F2) in form.keypress method. I'd prefer the latter, because that way everything is contained within the form.
>
>Alternately (but this is a kludge, and I'm not sure it would work), you could have a hotkey on your button, if you include a "\<" string before the hotkey character in button's caption. If button.caption="Bu\ .Signature { margin-top: 12px; color: #666666; } .Signature a { color: #666666; }
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform