Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cannot add objects to a class based on a control class.
Message
 
À
28/03/2005 15:08:28
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
00999521
Message ID:
00999525
Vues:
15
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform