Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Tip of the Day --- Pageframe and Page Refreshing
Message
De
02/12/1999 09:55:09
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Tip of the Day --- Pageframe and Page Refreshing
Divers
Thread ID:
00297873
Message ID:
00297873
Vues:
80
Hi All,

Here's an "oldie but goldie": If you need to access properties for objects on Pages in a Pageframe where the host Page is not the ActivePage, you may get improper results as objects on the non-ActivePages are not refreshed with ThisForm.Refresh().

Some people resolve this by putting a This.Refresh() in the Activate of each page. This helps somewhat, but it still means that the objects properties are not necessarily reflecting the current form state, i.e., like going into edit mode.

The following code, put into the Refresh of the Pageframe itself, resolves this:
FOR i = 1 TO THIS.PageCount
   IF i # THIS.ActivePage
      THIS.Pages(i).Refresh()
   ENDIF
ENDFOR
This code ensures that all Pages are refreshed whenever the Form is refreshed. Not the code that disallows a refresh of the ActivePage: This would be redundant as the ActivePage is refreshed.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform