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

Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform