Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding custom optionbuttons to optiongroup
Message
From
21/04/1998 16:43:44
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00091946
Message ID:
00093815
Views:
27
>One possible way of doing this is to set up an OptionGroup subclass that contains cClassLib and cClassName properties. Set these to be the OptionButton you really want to use. Visually design the OPG however you want. Then in the OPG Init() use AddObject() to add the needed number of your buttons, copy the properties from the orginal buttons to the new ones, then RemoveObject() the originals.

I have a OptionGroup base class that does this, as well as a OptionButton base class that is the default OptionButton for this OptionGroup, though a subclass of that OptionButton can be used. It's not as flexible as I would like, since I have to generate a subclass for any variantion of any given button (such as method code). But it's much better than what is originally there.

I do have to wonder why OptionButtons and other base classes were written as code inside other .VCX class definitions, rather than independent class records in the .VCX.
David M. Stowell
Ravenslake Consulting
Chicago, Illinois

e-mail: davidstowell@ravenslakeconsulting.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform