Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

adding pages to a pageframe thru code 1

Status
Not open for further replies.

rickesilaw

Programmer
Jun 24, 2002
154
CA
I have an application where I want to add 1,2 or 3 new pages to an existing form but not all users will add all pages so some users will have 1,2 some will have 1, some will have 1,2,3 etc.

On each page I want to add a variety of controls, textboxes, etc (I think I have to create class then add class to the page).

I know by increasing the pagecount and setting the caption etc, I can increase the number of pages - but since they vary, how do i add objects to a page if the page number varies.
 
rickesilaw

Design a pageframe will all pages, and disable them depending on the access level, using the itin event of the pageframe.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Thx Mike - that works but not as "pretty" as I would like - I would like way to have page7 not visible (not just disabled) if possible. I would like to be able to add pages and controls on pages thru code so only those in use show.
 
I just found this in documentation so this should let me add code based on index of page

thx for your help Mike.


You can refer to a page in a page frame by name as in the following example:
myFrame.MyPage1
You can also refer to a page by its index number using the PageFrame Pages property. This is consistent with the control collections in other Visual FoxPro containers.
myFrame.Pages(2).Enabled = .T.
This index does not necessarily equal the PageOrder property. You might have three pages with PageOrders of 2, 3, and 5. You can refer to these pages as follows:
myFrame.Pages(1)
myFrame.Pages(2)
myFrame.Pages(3)
 
RICKESILAW

What we use here, are tabless (no tabs) pageframes, and adding a next button to flip to the next page, and you can control to which page you are going to flip to depending on the user level or other conditions, and the user never notices there are other pages he never accesses.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
I like that idea (especially for some of our new billing) -It won't work for this particular problem as some of the first pages are used in combination with the potential new pages. Cool idea tho - thx.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top