How to Create a Hot Key for a Push Button with a BitmapID: Q125733 2.50 2.50a 2.50b 2.60 2.60a WINDOWS kbtool The information in this article applies to:
SUMMARYThe FoxPro Screen Builder usually allows the association of a hot key combination with a push button. A hot key allows a key stroke or a combination of key strokes to activate a push button without physically placing the cursor on the object. Unfortunately, a picture push button cannot possess a hot key combination. However, the ON KEY LABEL command allows specific key strokes to emulate a hot key combination. This article shows by example how to do it.
MORE INFORMATIONThe following steps illustrate how to remap the CTRL+F1 keys to activate the Valid code snippet of a picture push button. The FOXPRO.BMP file is located in the FoxPro for Windows main directory. 1. Create a screen with a picture push button by using the FOXPRO.BMP file. 2. In the Setup code of the screen, type the following code:
3. Save the Setup code snippet and open the Valid code snippet of the
4. Save the Valid code snippet and close the push button builder
5. Open the Screen Layout dialog, choose the Code button, and click
6. Add another push button, and type "Quit" in the "Push Button
The ON KEY LABEL command in the Setup code snippet remaps the CTRL+F1 keys
to activate the procedure in the Valid code snippet of the picture push
button.
This functionality gives the illusion of a hot key combination for the push button. The ON KEY LABEL CTRL+F1 statement in the Cleanup and Procedures code snippet resets the key combination back to its default value when exiting the screen. Other than using the KEYBOARD "{TAB}" command, there is no way to set the focus to a button after pressing CTRL+F1. Using the SHOW GET <memvar> command or the _CUROBJ will not set the focus to the push button. Additional reference words: FoxWin 2.50 2.50a 2.50b 2.60 2.60a KBCategory: kbtool KBSubcategory: FxtoolSbuilder
|
|
Last Reviewed: May 1, 1996 © 1999 Microsoft Corporation. All rights reserved. Terms of Use. |