KeyPress Event in Check Box Allows Y or N

ID: Q130081

3.00 WINDOWS

 kbui

The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, version 3.0

SUMMARY

A check box object can accept a key press of Y or N to toggle the state of that object in the KeyPress event.

MORE INFORMATION

Place the following code in the KeyPress event of the check box, so that a user could press the Y or N key when the check box has the focus:

   LPARAMETERS nKeyCode, nShiftAltCtrl
   DO CASE
      CASE nKeyCode = 121 OR nKeyCode = 89  && y or Y
         This.Value = .T.
      CASE nKeyCode = 110 OR nKeyCode = 78  && n OR N
         This.Value = .F.
   ENDCASE

Additional reference words: 3.00 VFoxWin KBCategory: kbui KBSubcategory: FxtoolFormdes
Keywords          : kbcode FxtoolFormdes 
Version           : 3.00
Platform          : WINDOWS


Last Reviewed: May 22, 1998
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.