Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Instantiating Form class in INIT of another form
Message
De
10/07/2018 13:03:28
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
01661090
Message ID:
01661091
Vues:
78
>Hi,
>
>I have a form that will have a few "lookup" forms that will be opened and hidden quite often. So, I prefer to instantiate these "lookup" forms in the INIT of the parent form. Here is how I tried it:
>
>
>*-- in the INIT method of the parent form
>thisform.NewObject( "LookupForm1", "LookupForm1", "MYLIB.VCX")
>
>
>The error I get is "Object class is invalid for this container"
>
>What am I doing wrong?
>
>TIA
>
>UPDATE: Decided to change the approach:
>Created property oLookupForm1 and then in the INIT of the parent form instantiate it as:
>
>thisform.oLookupForm1 = CREATEOBJECT( "LookupForm1" )
>
>Then, in Destroy method, set value to NULL.

Right. A form can't contain another form, but it can point to one with an object property.

Tamar
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform