Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Tip of the Day --- Pageframe and Page Refreshing
Message
From
02/12/1999 09:55:09
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Tip of the Day --- Pageframe and Page Refreshing
Miscellaneous
Thread ID:
00297873
Message ID:
00297873
Views:
81
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
Next
Reply
Map
View

Click here to load this message in the networking platform