Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form Classes
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Miscellaneous
Thread ID:
00355853
Message ID:
00355911
Views:
17
>>>>I would suggest to have one form with the 2-page pageframe, and instantiate the necessary number of pages at runtime with .Addobject method. <<
>>
>>
>>I'm a bit cloudy about this technique. Where is the addobject method located? Is it in the original 2-page pageframe? What would that code look like?
>>
>>Thanks.
>
>Any container class has Addobject method. In your case you may add the property to the form, say nPagesNumber. Set it to the number of pages required for yor form instance (say, 5). In Form.Init() you may put the code:
>
>lnPagesExist = thisform.Pageframe1.PageCount
>IF lnPagesExist < thisform.nPagesNumber
>
>FOR n = lnPagesExist to thisform.nPagesNumber
>thisform.pageframe1.addobject("Page" + alltrim(str(lnPagesExist + 1)),"Page")
>ENDFOR
>
>ENDIF
>

Why not pass an array to the Form Init describing what pages to add, and pass that along to the PageFrame, which spins through the array and adds the designated pages, or some similar strategy. I think the confusion was the thought that the Form, rather than the PageFrame contained the Page instances; it's just a matter of whether he builds distinct forms for each instance, or creates a form which accepts a set of pages to instance, which gets passed along to the PageFrame that knows what Pages it had to instance...

>Then you can change page captions to appropriate ones.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform