Q130081: KeyPress Event in Check Box Allows Y or N
Article: Q130081
Product(s): Microsoft FoxPro
Version(s): WINDOWS:3.0
Operating System(s):
Keyword(s): kbcode
Last Modified: 10-FEB-2000
-------------------------------------------------------------------------------
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 query words: VFoxWin 3.00
======================================================================
Keywords : kbcode
Technology : kbVFPsearch kbAudDeveloper kbVFP300
Version : WINDOWS:3.0
=============================================================================
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.
Copyright Microsoft Corporation 1986-2002.