Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cannot add objects to a class based on a control class.
Message
 
To
28/03/2005 15:08:28
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
00999521
Message ID:
00999525
Views:
17
>Hi, everyone.
>
>I have a control base class (that's it: the base class is "control"). I can add objects to it. But if I subclass it, I cannot add objects in design time in the subclass. The error message is shown in the thread title.
>
>This means if I need several controls based on Control class, I have to subclass each of them from native base class and copy&paste the common methods/properties? If yes, then where's the OOP here?

The Control class is for building a single control, not a container or collection of controls. While it can be a complex control, you can't add to it later in subclasses or instances of it. If you need a control that you want to add more controls to in subclasses or instances, use the container class instead of the control class. And if you don't want the objects you add to the container to be able to be selected individually in instances, make them protected.

HTH,
Chad
_________________________________
There are 2 types of people in the world:
    Those who need closure
Previous
Reply
Map
View

Click here to load this message in the networking platform