On Apr 22, 2006, at 3:18 PM, Charles Yeomans wrote:

The order is mostly intentionally undocumented. You're better off writing code that does not depend on the order of events.

Then how would you suggest this is best handled? The window has a property called db which needs to be set for most of the functionality of the window, including the open event of the listboxes and popup menus within the window. Should I set db in each of these Open events to ensure that it is set when they are called? At this time, I'm setting it in the Window.Activate event, which seems to work. It seems a pain to have to put the same line of code in every control's Open event given that I don't know which will fire first. Or, given that controls execute their Open events in the order of the control order (is this documented and guaranteed?), I could place an invisible control on the window, make it the first in the order, and place my property setting code there.

On Apr 22, 2006, at 3:08 PM, [EMAIL PROTECTED] wrote:
I don't know if it's documented, but through my experience, I have found the order to be:

Controls.Open (in control order)
Window.Open
Window.Activate

This is actually contrary to what I'm experiencing, perhaps because of platform differences. The order I've found with my testing is:

Window.Activate
Controls.Open
Window.Open

Regardless, to have the control Open events fire before the Window's Open event seems backward to me.

I don't mind that the Activate fires every time the Window comes to the front, as the code within it is very simple at this point:

db = App.Database

Mostly, it's so I don't have to type "App.Database" every time I need to refer to it within the Window's code.

Perhaps a Constructor is a better option? Basically, I need that line above to execute before pretty much anything else.

Thanks,
Chuck


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to