×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Run Code after Pageframe Activate is complete?
2

Run Code after Pageframe Activate is complete?

Run Code after Pageframe Activate is complete?

(OP)
In my application I have a Pageframe that contains a grid. In the Activate of the 'Page' I have some code that runs a 'check up' routine. Whilst this code is executing the 'Page' is waiting for the code to complete before it shows the form in full. You can still see parts of the previous screen whilst the 'check up' routine is running and the Grid being updated.

What I would like to do is show the form in full and then run the code for the 'check up' routine. I don't mind seeing the completed form whilst the Grid is being updated (quite expect it), but not the form being slowly created whilst the Grid is being updated . How would achieve this?

The 'check up' routine changes the 'Back Color' of the Grid's individual Cells dependent on contents in another cursor.

Regards,

David.

Recreational Developer / End User of VFP.

RE: Run Code after Pageframe Activate is complete?

A simple solution would be to move the code from the Activate Event of the Page to the GotFocus event of the first page control in tab order.

That would have a strange dependency of the page with its first control, but you may use an extra button you move off the visible page area (give it a negative top/left larger than width/height), set it to have tabindex 1. Then activate finishes and the next event will be This controls When event, but that's still too early, I think.

You may also look into UIEnable/UIDisable events of all page controls. That'll mean a lot of work to let all UIDisable make the controls invisible and all UIEnable to make controls visible, but give it a try for just one or two controls of the previous and the page in question. It will only solve the problem of previous page controls being visible while the current page is still in Activate event, so when you want that to be instant the only viable solution is makinng use of such an extra control and VFPs event chain.

You could also use a timer to have the code about the backcolors. A timer which you disable at design time, enable at Page.Activate and which disables itself in the Timer even. The effect is that the tier starts after say 10 ms when the Activate already is through. You still have an extra control on the page, though - the timer. This solution just can be used in more situations, if you make that a timer class and subclass timers with different Timer events for the cases you use them or make the code it executes a dynamic parameter of the timer class init.

And then there is BindeEvents and its parameter controlling whether the object event itself runs first or last, That's needing another class to drag to the page and bind the Activate event to one of its methods.

Chriss

RE: Run Code after Pageframe Activate is complete?

(OP)

Quote (Chris Miller)

You could also use a timer to have the code about the backcolors. A timer which you disable at design time, enable at Page.Activate and which disables itself in the Timer even. The effect is that the tier starts after say 10 ms when the Activate already is through.

I quite like that idea, I will give it a try.

Regards,

David.

Recreational Developer / End User of VFP.

RE: Run Code after Pageframe Activate is complete?

(OP)

Quote (Chris Miller)

You could also use a timer to have the code about the backcolors. A timer which you disable at design time, enable at Page.Activate and which disables itself in the Timer even. The effect is that the tier starts after say 10 ms when the Activate already is through.

Well, that worked a treat, thank you very much.

Regards,

David.

Recreational Developer / End User of VFP.

RE: Run Code after Pageframe Activate is complete?

The LockScreen property is really used for this. You'd set thisform.lockscreen=.T. before you start updating the page and then thisform.lockscreen=.f. when you're ready to reveal the changes.

Mike Yearwood - Former FoxPro MVP

RE: Run Code after Pageframe Activate is complete?

(OP)

Quote (Mike Yearwood)

The LockScreen property is really used for this.

Many thanks Mike, I will try that. It's all part of the learning curve to try the various options available.

P.S

The 'Lock Screen' gives the required effect; such that I will use it on the other 'Page Activate' routines where I also notice a (slightly) slow transition.

Thanks again for your suggestion.

Regards,

David.

Recreational Developer / End User of VFP.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close