Information générale
Catégorie:
Codage, syntaxe et commandes
AddObject adds an object to a container. It also includes the new object in the Controls collection of the container.
CreateObject creates an object and stores a reference to it in a variable/property. It doesn't touch any collection of any container.
When an object is added to the Controls collection of a container, the container becomes "aware" of the object. For example, a label created with AddObject can be visible in the container for which it was created, a label created with CreateObject cannot be made visible because it is not owned by any container.
Vlad
>Can someone tell me the difference between the two and when to use each?
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement