PRB: List Box Choices Not Highlighted Properly

Last reviewed: March 21, 1995
Article ID: Q127837
The information in this article applies to:
  • Microsoft FoxPro for MS-DOS, versions 2.6 and 2.6a
  • Microsoft FoxPro for Unix, versions 2.6

SYMPTOMS

In both FoxPro for MS-DOS and FoxPro for Unix, when you place a list box on a screen, the items in the list box are not highlighted until an item is selected from the list box.

WORKAROUND

Using the KEYBOARD command in conjunction with a variable that is evaluated in the WHEN clause of the list box object, have FoxPro highlight the first item in the list box to provide a visual indicator to the user that they are in a specific list box. See the More Information section for details.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

  1. In FoxPro for MS-DOS or UNIX, issue these commands:

    SET DEFAULT TO SYS(2004)+"\TUTORIAL" USE CUSTOMER in 1

  2. Issue this command:

    CREATE SCREEN listtest

  3. Choose Screen from the Layout menu.

  4. Select the Window radio button, and name the screen LISTTEST in the Name box.

  5. Select the Screen Code, Setup check box.

  6. In the LISTTEST Setup code snippet, place this command:

    TRIGGERED = .F.

  7. Close the setup code screen.

  8. Back in LISTTEST.SCX, choose Screen, List.

  9. In the List Type box, choose Prompt Field. In the Field box, type in Company.

  10. In the Variable box, type in the value LIST1.

  11. In the When clause of the list box, type the following as a procedure:

        IF (!Triggered)
           KEYBOARD "{Home}"+"{Home}"
           Triggered = .T.
        ENDIF
    

  12. Choose the OK button. Back in the List Type dialog, choose OK a second

        time.
    

  13. Choose Program, Generate from the FoxPro menu. When asked if you want

        to save the environment information, choose Yes.
    

  14. Choose Program, Do from the FoxPro menu. Select LISTTEST.SPR from the

        list of programs.
    

  15. Your screen should show one list box with the first item in the list

        highlighted.
    


Additional reference words: FoxDos FoxUnix 2.50 2.50a 2.50b 2.60 2.60a list
box highlight
KBCategory: kbui kbprg kbprb
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: March 21, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.