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.


Program Flow in a PageFrame

Program Flow in a PageFrame

Hi all,
Sorry for the bombardment of questions, but I'm re-tooling my application to meet a lot of the best practices I'm seeing here, and as a result, I'm colliding into all kinds of things I've never seen before.
I've been working with a pageframe in one of my forms for a long time. It's the "core" of the application. But I just discovered a surprising behavior, that I find weird, but I also understand sort of WHY it happens, but not sure what the best method of managing it is.
My pageframe has 8 pages in it, and as I moved from one page to another, there some stuff that needs to happen (mostly related to grid setups). The surprise came when I discovered that the INIT of a page doesn't occur when the pageframe is being built... only for "Page 1". So when I click the tab for Page 2, it fires the Activate event, BUT without the INIT of the page ever happening, and there is setup there that I was expecting to have happen. I didn't want to put it in the Activate event, because that fires all the time when anything in the form brings attention back to the tab.

So the question is this: What is the best way to manage this? I thought the INIT was an event that just happened, and I would have expected it to happen automatically when I click on the tab with a sequence of INIT first, then Activate... but that is clearly not what is happening. I'm quite confused by this.

Best Regards,

"Everything should be made as simple as possible, and no simpler."hammer

RE: Program Flow in a PageFrame

Init of all controls happens once with form innit. Activating a page doesn't init it, it already is inited, or it wouldn't be there to be activated. Pages have Activate/Deactivate happening.

Bye, Olaf.

RE: Program Flow in a PageFrame

That's odd though, because I put:

MESSAGEBOX("Now running page 2 init") in the page's init clause, and it never fires.

Shouldn't that messagebox appear then sometime when the form is loading?

Best Regards,

"Everything should be made as simple as possible, and no simpler."hammer

RE: Program Flow in a PageFrame

It works for me, there is no way around a control init. Since the messagebox even is blocking (modal) further program flow, it must be there.
Check, if you'r ereally starting the form you have put your code in.

Event order is page1 init, page2 init, pageframe init, then form init. It's always inside out.

Bye, Olaf.

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!


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