How to Make a Modal List Box on a FormID: Q138918 The information in this article applies to:
SUMMARYWhen doing data entry there are times when you want the user to make a selection before moving on. This article shows how to make a list box that the user cannot leave until they make a selection.
MORE INFORMATIONIf you are not familiar with creating classes or using the Form Designer and the different controls please see Chapters 9 - 11 in the Developer's Guide.
Steps to Make a Modal List Box1. Create a new class based on a Container. Name it MyList, and store it in 2. Set the following Properties for the MyList container:
3. Add a new Property to the class, and call it Flag.
4. Add a list box to the container, and set the following properties for 5. In the GotFocus event of MyList, enter the following code:
6. In the LostFocus event of MyList, enter the following code:
7. In the Click event of List1, enter the following code:
8. In the Valid event of List1, enter the following code:
9. Save the class, and then close the Class Designer.
10. Create a new Form. 11. Place a text box on the form, and then place the MyList container class If you press the TAB key to move into the list box, you will not be able to
press the TAB key to move back out unless you pick an item from the list
using the mouse or keyboard.
Additional reference words: 3.00 VFoxWin KBCategory: kbtool kbhowto kbcode KBSubcategory: FxtoolFormdes |
Last Reviewed: October 31, 1995 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |