>>Hi...vfp6 user here
>> I am trying to display a container class on a page in a pageframe.
>> Would I:
>> 1. Use CreateObject()
>>OR 2. Use AddObject()
>>
>> AND
>>
>> Would I:
>> 1. Put the code in the 'Activate' method of the page?
>>OR 2. Put the code in the 'AddObject' method of the page?
>>
>> In any case, when I try:
>> oObj = CreateObject('myclass','myclasslib'), then
>>oObj.Visible = .t., I cannot see my class on the screen. It is there, because it is in the debugger.
>>
>>thanks, Randy
>
>Randy,
>VFP3 and up can use addobject() and VFP6 could also use NewObject().
>In page.activate code like (assuming you use mycontainer as objectname and it's in c:\myclasses\myclasses.vcx):
>
>
with this
>if !type('.MyContainer')='O'
> if !'MYCLASSES.VCX'$set('classlib')
> set classlib to 'c:\myclasses\myclasses.vcx' additive
> endif
> .Addobject('MyContainer','myclasses')
> * VFP6 NewObject() could be used in place of preceding 4 lines
> * .NewObject('MyContainer','myclasses','c:\myclasses\myclasses.vcx')
> with .MyContainer
> * set properties like left, top
> .Visible = .T.
> endwith
>endif
endwith
Cetin