I have created a form with multiple Page Frames. When adding a new record, the current page is the only page that the refresh method effects. Can someone advise me on a way to refresh the entire form.
The reason the only page refreshed is the visible is that it takes time to refresh things and only one page is visible to the user. There are two approaches that I use to address this situation, one slightly more complicated, but better I beleive, than the other.
The simple one;
In each Pages Activate event place this line of code;
This.Refresh()
This will refresh each page as the user makes it visible. It has the benefit of NOT rereshing pages the user cannot see until they try to look at them.
The second approach, that I usually use, is this. I have a label class named lblPageRefresher that is has its Visible Proeprty set to .F. and has this code in its UIEnable event;
IF lEnable
This.Parent.Refresh()
ENDIF
I place one of these on each page of my pageframes. This label will fire its UIEnable event whenever the visibility of its page changes, that is the page is entered or left. The LEnable argument is .T. when the page is becoming visible, so when that happens the labe will cause the page to be refreshed.
You might also consider wrapping the refresh in a lockscreen. This will speed up the refresh and make it look much smoother to the user. The code I usually use looks something like this.
In the activate of the page.
local llocked
llocked = thisform.lockscreen
thisform.lockscreen = .t.
** put any other code here
this.refresh
thisform.lockscreen = llocked
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.