Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Pageframe Page Activate vs. Click methods
Message
From
11/09/2018 03:10:41
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
11/09/2018 00:48:59
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01661937
Message ID:
01661957
Views:
50
>>This is why I asked the question so that I can avoid the "bite me later on" thing. What you are saying makes sense.
>>And I realized that what I need to do is to change the code in my Activate method and call form.Refresh() only when user actually changed from one page to this page. But if this page Activate fires simply because the form gets focus back, the form.Refresh() should not be called.
>>Thank you.
>
>Another option is to add a custom property to a page ("PageX"), named something like .NeedsRefresh, with a logical value. If changes on another page (or anywhere else, for that matter) require a refresh of PageX, it can set PageX.NeedsRefresh = .T.
>
>The code that refreshes PageX has PageX.NeedsRefresh = .F. at its bottom.
>
>PageX.Activate() only calls the refresh code if .NeedsRefresh = .T.

I was thinking about the "form gets focus back", in the same way. When form loses focus (i.e. in .deactivate()), set a form.needsrefresh=.f. (but set it when recno() changes and in other situations when it really needs it), so when in .activate() check for that property and call .refresh() if it's true. I think I've actually seen this somewhere in use.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform