How to Add Buttons to an OptionGroup DynamicallyID: Q147726 3.00 WINDOWS kbtool kbhowto The information in this article applies to:
SUMMARYBy using the Visual FoxPro class designer, you can create an option group class that will allow you to add multiple buttons to an option group. You can carry forward various properties of the original class by creating a method that will take care of adding and aligning the buttons for you. This article shows by example how to do it.
MORE INFORMATION
Step-by-Step ExampleThe following steps create a generic horizontal optiongroup class that can be added to a form. It has an addbuttons method that allows you to add additional buttons to the form at run time. 1. On the File menu, click New, and choose a new Class. 2. Create a new class called NewOption based on the OptionGroup class. 3. In the Class Designer, select and delete the second option button 4. On the Class menu, click New Method, and create a new method called
5. From the Properties sheet, set the object to be the optiongroup
6. Add the following code to the addbuttons method to take care of adding
7. Close and save this class, and then add it to a form.
8. Place a command button (Command1) on the form, and put the following 9. Run the form, and click Command1. You will see that four buttons now
Additional reference words: 3.00 VFoxWin
KBCategory: kbtool kbhowto
KBSubcategory: FxtoolFormdes
|
Last Reviewed: May 22, 1998 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |