VFP8 - SP1

I have subclassed a form with a pageframe, and have some problems with it
with the Pagecount property. In the class I give the pageframe 10 pages.
Then when I use it in a form I set the property to e.g. 3 in the form init
event (I have also tried the pageframe init event). The result is that it
still comes up with 10 pages. I have found one solution, and that is to
duplicate the line in the init event - and it works:

*!* form init
thisform.pageframe1.pagecount = 3
thisform.pageframe1.pagecount = 3

This does not make sense. Am I missing something, or is this a known
problem?

Zeke

Re: Subclass problems - pageframe by Stefan

Stefan
Tue Aug 10 02:40:47 CDT 2004

I'd suggest to put only those pages in your class that you actually
want to use in every derived instance.
Others could be AddObject'ed dynamically, either as predefined
page classes or containers to put on a page.


hth
-Stefan

"Zeke Galama" <nospam@mymail.com> schrieb im Newsbeitrag
news:OqF1vcofEHA.3476@tk2msftngp13.phx.gbl...
> VFP8 - SP1
>
> I have subclassed a form with a pageframe, and have some problems with it
> with the Pagecount property. In the class I give the pageframe 10 pages.
> Then when I use it in a form I set the property to e.g. 3 in the form init
> event (I have also tried the pageframe init event). The result is that it
> still comes up with 10 pages. I have found one solution, and that is to
> duplicate the line in the init event - and it works:
>
> *!* form init
> thisform.pageframe1.pagecount = 3
> thisform.pageframe1.pagecount = 3
>
> This does not make sense. Am I missing something, or is this a known
> problem?
>
> Zeke
>
>


Re: Subclass problems - pageframe by nw9952

nw9952
Tue Aug 10 14:36:12 CDT 2004

assume class property nPages for use in each instance
in the Init,

if This.nPages>0
for lnCnt=This.PageCount to This.nPages+1 step -1
lcPage = "Page" +ltrim(str(lnCnt))
This.RemoveObject(lcPage)
endfor
endif

"Zeke Galama" <nospam@mymail.com> wrote in message
news:OqF1vcofEHA.3476@tk2msftngp13.phx.gbl...
> VFP8 - SP1
>
> I have subclassed a form with a pageframe, and have some problems with it
> with the Pagecount property. In the class I give the pageframe 10 pages.
> Then when I use it in a form I set the property to e.g. 3 in the form init
> event (I have also tried the pageframe init event). The result is that it
> still comes up with 10 pages. I have found one solution, and that is to
> duplicate the line in the init event - and it works:
>
> *!* form init
> thisform.pageframe1.pagecount = 3
> thisform.pageframe1.pagecount = 3
>
> This does not make sense. Am I missing something, or is this a known
> problem?
>
> Zeke
>
>