>Hi,
>
>I intend to create a PageFrame which when drop on a form it starts with ZERO page
>Then when I increase its PageCount property from 0 to N (>0), there will be N pages added which are
>all based on a page class of mine (instead of the ordinary VFP Page class)
>The below is what I have done:
>
>
>**************************************************
>*-- Class: pagtest (i:\vfp9\work\text.vcx)
>*-- ParentClass: page
>*-- BaseClass: page
>*-- Time Stamp: 01/07/09 04:05:14 PM
>*
>DEFINE CLASS pagtest AS page
> Caption = "Page1"
> Height = 199
> Width = 199
> *-- XML Metadata for customizable properties
> _memberdata = ""
> Name = "pagtest"
>ENDDEFINE
>*
>*-- EndDefine: pagtest
>**************************************************
>
>
>**************************************************
>*-- Class: pgftest (i:\vfp9\work\text.vcx)
>*-- ParentClass: pageframe
>*-- BaseClass: pageframe
>*-- Time Stamp: 01/07/09 04:06:14 PM
>*
>DEFINE CLASS pgftest AS pageframe
> ErasePage = .T.
> MemberClassLibrary = "text.vcx"
> MemberClass = "pagtest"
> PageCount = 0
> ActivePage = 0
> Width = 241
> Height = 169
> *-- XML Metadata for customizable properties
> _memberdata = ""
> Name = "pgftest"
>ENDDEFINE
>*
>*-- EndDefine: pgftest
>**************************************************
>
>
>I then drop an instance the pgftest on a form, increase is PageCount to 2 and run the form.
>At first everthing seems OK, until I add codes to the Init() method of the pages.
>
>Whatever custom code that I place in the Init() method of the pages inside that pgftest, say a MessageBox([Hello]), the code simply won't run, as though the initializatoin process simply skip the ini methods of the pages.
>
>Isn't MemberClass property is where I define the default member of the PageFrame?
>Would anyone kindly tell me what have I done wrongly?
None .
it is on VFP documentation.
Note
On an .scx form, if you add instantiation code to the member class's Init event, Visual FoxPro disregards that code and only the Init code for the member class definition runs. However, with visual class library (.vcx) forms, Visual FoxPro creates a true subclass. You can safely add instantiation code for other events such as Click.