Thanks.
Is there something like
for each opage in this
for each ocontrol in this.opage
copy origpage to mypageclass
endfor
endfor
>Bhavbhuti,
>
>Upgrade to VFP8 and you can directly use your own Page subclasses.
>
>In earlier versions you can swap out classes. I did this in one of my Grid subclasses to swap out Header class objects.
>
>
for each loCol in this.Columns
> with loCol
> .Header1.Alignment = 0
> if ( .Header1.Class == "Header" )
> lcX = .Header1.Caption
> .RemoveObject( "Header1" )
> .AddObject( "Header1", "hdrSeeker", "" )
> .Header1.Caption = lcX
> .Header1.FontBold = .f.
> endif
> endwith
>endfor
>
>This let me design the grid completely visually but change it at runtime.
>
>I never really came up with a good case to need a page subclass. Swapping them out will be a little bit harder because you'll have to "move" all of the objects contained by one page to the other. But since a control can't change it's containership once instantiated you'd have to replicate the controls and that can be problematic. You are probably better off using a container of controls that won't get instantiated until your new page exists.
>
>All this it too much work and inconvience for my tastes. Using the PageRefresher class from my website on my cPageFrame class has really meant that I've never needed a Page subclass.
>
>>I guess custom properties on the pageframe are the name of the game. Incidently I had recently put up a thread asking if it is possible to switch the base class of say a page. At design time I use the default VFP page that I get. Define a programatical page class with my customizations MyPage. At run time the form switches the base class of all the pages from Page to MyPage thus take advantage of MyPage class.