What is the best procedure to add a new Page, at run time, to a Pageframe with a Caption,code and Data from a table when activated. I am using VFP8 and am unable to find the best procedure.
Thanks in advance,
Bob
WITH ThisForm.PageFrame1
.Visible = .f.
.PageCount = .PageCount+1
WITH .Pages(.PageCount)
.Caption = "myCaption"
.AddObject(....)
** To add all the controls to this added page
** etc to set the data.
.Visible = .t.
ENDWITH
.Visible = .t.
ENDWITH
2. Having provided the above code., this may not alway be the best way. If you already know, what exactly is your page that you want to make available, you can create that page in the pageframe and st its visible propety to .f. When you dcide to show the page, set its visible property to .t.
3. If you acnnot decide that, you can have a pageClass created earlier and saved in your application. When, you want to add the page,
Use the addObject of the PageFrame to add your pageclass. This will help to have all the controls instatly without building them up during runtime.
Following ramain's suggestion of adding a pageclass, if you have a version of VFP that does not have a pageclass, create a borderless container, add your controls to the container and save it as a class.
Then add the container to the empty page using AddObject().
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.