How to Select (Highlight) a GET Field with a Mouse Click

Last reviewed: April 30, 1996
Article ID: Q128513
The information in this article applies to:
  • Microsoft FoxPro for Windows, versions 2.5, 2.5a, 2.5b, 2.6, 2.6a

SUMMARY

With the default settings, when you can press the TAB key to move into a GET field, the field that becomes active is selected (highlighted). This is due to having the "Select Field on Entry" Option selected under the Field properties dialog box for the object. However, clicking the mouse to move into a GET field positions the mouse pointer (cursor) at the position you clicked in the field.

This article shows by example how to have a mouse click work the way the TAB key works to select (highlight) the GET field.

MORE INFORMATION

To make the mouse click select the field on entry, add the following code to the WHEN clause under the field Properties as a Procedure:

   KEYBOARD '{HOME}'      && Sends the cursor to the start of the field.
   KEYBOARD '{SHIFT+END}' && Selects entire field if text is clicked.
   KEYBOARD '{CTRL+A}'    && Selects entire field (See note below)

Retain the "Select Field on Entry" option so the TAB key functions correctly.

NOTE: The KEYBOARD '{SHIFT+END}' command handles the case where the user clicks to the left of the first character. In that case, without the KEYBOARD '{SHIFT+END}' command, the previous field is highlighted. Similarly, the KEYBOARD '{CTRL+A}' command ensures the entire field is selected (highlighted) if the user clicks in a blank area to the right of the text.


Additional reference words: FoxWin 2.50 2.50a 2.50b 2.60 2.60a
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 30, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.