Using _CUROBJ with Push Buttons

Last reviewed: April 29, 1996
Article ID: Q96356
The information in this article applies to:
  • Microsoft FoxPro for Windows, versions 2.5 and 2.5a
  • Microsoft FoxPro for MS-DOS, versions 2.0, 2.5, and 2.5a

To place the cursor on a specific push button when you are leaving a GET field, you must use the command _CUROBJ. For example:

  1. Using the FoxPro Screen Generator, create a screen that has one GET field and four push buttons. Call the push button variable "action". Call the push button prompts "Next", "Prior", "Save", and "Cancel".

  2. To move from the GET field to the push button labeled "Save" with one keystroke and without using the mouse, the GET field must contain a VALID clause. In this case, the VALID clause of the GET field will read:

          _CUROBJ=action+3
    

    This will place the cursor on the push button labeled "Save".

    NOTE: When a push button is selected, the value of action (the push button variable) changes. In order to have the cursor placed on the same push button every time after you leave the same GET field, place the following code in the push button VALID clause:

          action = 1
    

    This resets the variable to the first push button so that the cursor will be placed on the correct push button every time.


Additional reference words: FoxDos FoxWin 2.00 2.50 2.50a
KBCategory: kbprg
KBSubcategory: FxprgGeneral


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: April 29, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.