How to Enable One Check Box While Disabling the OthersID: Q138920 3.00 WINDOWS
The information in this article applies to:
SUMMARYMultiple check boxes are often necessary to gather required input. Frequently, it is desirable to disable the unselected check boxes after the first check box is selected. The example in this article illustrates how to disable the unselected check boxes in a form. Although option (also known as radio) buttons are generally the preferred of allowing users to make only once choice among a group of choices, this article provides an alternative method of doing so using check boxes.
MORE INFORMATIONThe form created by the following example contains three check boxes. When a check box is selected, its Value property is set to 1. After checking the Value property in the Click event of each individual check box, the Enabled properties of the remaining check boxes are changed to false (.F.). Changing these properties disables the check boxes.
Step-by-Step Example1. Create a new form, and name it Test.scx. 2. Place three check boxes on the form by using the Form Builder. 3. In the Refresh event of the form, place the following code:
4. In the InteractiveChange event of each check box, add the following line
5. If you want the disabled check boxes to appear in a different color,
6. Save and run the form.
7. Click any check box to select it, and the remaining check boxes are
Additional Notes
REFERENCESFor more information about Disabling check boxes in FoxPro 2.x, please see the following article in the Microsoft Knowledge Base:
Additional reference words: 3.00 VFoxWin
KBCategory: kbhowto
KBSubcategory: FxprgGeneral
|
Last Reviewed: May 22, 1998 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |