PRB: ENTER Does Not Activate the Default Push ButtonID: Q108037 2.5x 2.60 WINDOWS kbprg kbprb kbdocerr The information in this article applies to:
SYMPTOMSIn a screen that contains push buttons along with various other screen objects, the ENTER key does not always activate the default push button. Depending on the type of screen object (other than a push button) the cursor is in, pressing the ENTER key may advance the cursor to the next object, do nothing, or activate the default push button. The CTRL+ENTER key combination, however, always activates the default button. NOTE: The key combination above does not work if the screen contains only push buttons and no other objects.
RESOLUTIONUse the ON KEY LABEL command to send a CTRL+ENTER keystroke to the screen when the ENTER key is pressed.
Example Using the Screen Builder with Input Fields
10. In the Setup snippet window, type the following:
11. In the Cleanup snippet window, type the following:
12. Save the screen as TEST.SCX (assuming you do not already have a file
13. Generate TEST.SPR, then close the Screen Design window.
14. Run TEST.SPR. Note that when you press the ENTER key, the default push NOTE: If you remove the code from the Setup and Cleanup snippet windows,
regenerate the screen, and then run it, you will observe that pressing the
ENTER key advances the cursor through the first two fields instead of
pushing the default push button.
MORE INFORMATIONAccording to the online Help information for the SET KEYCOMP command and page L3-943 in the "Language Reference" manual, pressing the ENTER key always performs the default button's action when KEYCOMP is set to WINDOWS. However, this statement is not correct for all types of screen objects. When the cursor is in certain screen objects and the ENTER key is pressed, the cursor may advance to the next object, or it may remain in the current object. When KEYCOMP is set to DOS, the key combination CTRL+ENTER always activates the default push button. This key combination also works when KEYCOMP is set to WINDOWS. NOTE: The default push button is designated by the backslash and exclamation mark characters (\!) in the Screen Builder. Additional reference words: FoxWin 2.50 2.50a 2.50b 2.60 pushbutton KBCategory: kbprg kbprb kbdocerr KBSubcategory: FxtoolSbuilder
|
|
Last Reviewed: April 30, 1996 © 1999 Microsoft Corporation. All rights reserved. Terms of Use. |