>>>>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
>
>Then you can change page captions to appropriate ones.
A little correction to this code:
lnPagesExist = thisform.Pageframe1.pagecount
if lnPagesExist thisform.nPagesNumber
for n = lnPagesExist+1 to thisform.nPagesNumber
thisform.Pageframe1.addobject("Page" + alltrim(str(n)),"Page")
endfor
endif
But I may suggest to use mhTab (from UT files section) instead and just hide the pages, which are not needed.
If it's not broken, fix it until it is.
My Blog