Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using PageFrames
Message
 
To
16/06/1998 12:31:36
Jeroen Naus
Harte-Hanks Europe
Hasselt, Belgium
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00108408
Message ID:
00108835
Views:
43
>This is some cool stuff you're telling me right and here and it will be useful in the future. The only problem is, that in my case a generically add pages to the pageframe and so I need to generically add code to these pages also. It would be easier to set up a proper ancestor page class for these ? And I need to do all this work to trigger a pagechange event ?
Jeroen,

No, you don't. You can define a page class in a PRG file as below;
 DEFINE CLASS MyPage AS PAGE
    PROCEDURE Activate
        * Whatever you want
    ENDPROC
 END DEFINE
Name the PRG MyPages.prg. In your code you simply do something like this;
SET LIBRARY TO MyPages.PRG ADDITIVE
WITH THISFORM.PageFrame1
   .PageCount = 0
   FOR lnCnt 1 TO 5
       lcPage = "Page"+ STR(lnCnt,1)
       .AddObject(lcPage,"MyPage")
   ENDFOR
ENDWITH
There you just removed all the default pages from the pageframe and added 5 of your own class. You could easily have a separate class for each page and do it this way;
SET LIBRARY TO MyPages.PRG ADDITIVE
WITH THISFORM.PageFrame1
   .PageCount = 0
   .AddObject("Page1","MyPage1")
   .AddObject("Page2","MyPage2")
   .AddObject("Page3","MyPage3")
   .AddObject("Page4","MyPage4")
   .AddObject("Page5","MyPage5")
ENDWITH
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform