Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
PageFrame: generic handling of .ActivePage
Message
De
10/12/2014 16:35:04
Al Doman (En ligne)
M3 Enterprises Inc.
North Vancouver, Colombie Britannique, Canada
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
PageFrame: generic handling of .ActivePage
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows Server 2003
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01612127
Message ID:
01612127
Vues:
53
From time to time I'm asked to enhance PageFrames by adding one or more new pages. Recently I added a seventh page to a pageframe and set its .PageOrder to 2 to make it the second page, rather than the last. All well and good.

However, there is code in the parent form that depends on hard-coded .ActivePage values e.g.
IF MyPageFrame.ActivePage = 3
...
Most of these are now broken, because what used to be the 2nd page is now the 3rd, third is the 4th etc.

Has anyone come up with a generic handler for this? My first thought is that the name of the page isn't likely to change, regardless of its .PageOrder so I could look at implementing something like
IF MyPageFrame.ActivePageName( MyPageFrame.ActivePage ) = "SomePageName"
...
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform