Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Instantiating Form class in INIT of another form
Message
From
10/07/2018 13:03:28
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
01661090
Message ID:
01661091
Views:
77
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform