Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
PageFrame.ActivePage, and PageFrame.Pages() Don't Corres
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00525159
Message ID:
00525543
Views:
14
You can add cActivePage property to the form and put code in Activate of every page to populate it with the active page name.
Thisform.cActivePage = This.Name
>I've got a pageframe control with 7 pages. They are designed in this name order:
>
>Page1, PageTPN, Page2, Page3, Page5, Page4, Page6
>
>(don't ask, I didn't do it :)). Now, in the code I need to know if Page2 is active. Normally I could use just ThisForm.pgfBase1.ActivePage without any problems, but here's the kicker. PageTPN is sometimes visible, sometimes not. So I can't use ActivePage, because when PageTPN *isn't* visible, then each page is numbered thusly (as far as activepage is concerned):
>
>Page1 - 1, Page2 - 2, Page3 - 3, Page5 - 4, Page4 - 5, Page6 - 6
>
>And when PageTPN *is* visible, the pages are numbered thusly:
>
>Page1 - 1, PageTPN - 2, Page2 - 3, Page3 - 4, Page5 - 5, Page4 - 6, Page6 - 7
>
>(note: there is no code that changes the numbers of each page, it's just the way the pageframe works apparently)
>
>So obviously ActivePage won't work. So I decided to use
>
>If ThisForm.PgfBase1.Pages(ThisForm.PgfBase.ActivePage).Caption = "Compounding Record"
>
>Well, that didn't work. Reason why? Apparently ActivePage doesn't correspond to Pages. When I tested that code, it returned "Label" when I was on the "Compounding Record" page. "Label" is the actual page 3. When I tested this, the "Compounding Record" was the "Activepage" number of 3.
>
>Am I doing something wrong here? Does this even make sense to anyone?
>
>TIA!
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform