FIX: Numeric Hot Keys Not Working with Push Buttons

Last reviewed: October 20, 1997
Article ID: Q110914
2.5x 2.6x WINDOWS kbui kbfixlist kbbuglist

The information in this article applies to:

  • Microsoft FoxPro for Windows, versions 2.5x, 2.6x

SYMPTOMS

When you are using hot keys (also known as access keys) for push buttons in FoxPro for Windows, the hot keys appear as underlined letters in the push button prompt. If KEYCOMP is set to WINDOWS, pressing ALT+<underlined letter> from a GET input field, a text editing region, a popup, or a list in the screen selects the push button. However, if the hot key is defined as a numeral (1-9) instead of as a character (A-Z), pressing ALT+<number> does not select the push button.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in Visual FoxPro 3.0 for Windows.

RESOLUTION

An alternative to using hot keys is to define ON KEY LABEL routines. The following example uses two alternatives to call the myvalid routine. The myvalid routine can be called from the ON KEY LABEL assignment or when a choice is made in the push button.

  SET KEYCOMP TO WINDOWS
  ON KEY LABEL alt+2 DO myvalid
  @ 3,4 GET mpush PICTURE "@* \<2test;\<Test" VALID myvalid() DEFAULT 1
  READ

  PROCEDURE myvalid
  WAIT WINDOW "in the valid"

You can also use this method in the Screen Builder. Define the ON KEY LABEL command in the Setup code of the screen, and define the myvalid routine in the Cleanup and Procedures code of the screen. When you are defining the push button, choose the Valid button. In the Valid dialog box, select the Expression button, and then type "myvalid()" (without the quotation marks) in the box.


Additional reference words: VFoxWin FoxWin 2.50 2.50a 2.50b 2.60 2.60a
fixlist3.00 buglist2.50 buglist2.50a buglist2.50b buglist2.60 buglist2.60a
KBCategory: kbui kbfixlist kbbuglist
KBSubcategory: FxtoolSbuilder
Keywords : FxtoolSbuilder kbbuglist kbfixlist kbui
Version : 2.5x 2.6x
Platform : WINDOWS
Solution Type : kbfix


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: October 20, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.