What can prevent a containercontrol from firing the open event?

Hi everyone,

I have a containercontrol, in a simple window, and an open event inside
I open the window with window.show, I created a new window before
the window gets opened and showed, no problem.
only thing is that the open event of the containercontrol is not fired
and so some initialisations did not take place.

if I place a break at the top of the open event of the CC it is not fired.

so what can prevent a CC from firing the open event when the parent window is opened ?

ps: the open event of the window gets normally fired.
ps2: the activate event of the CC is fired normally too. I’m making the inits there as a quick fix.
ps3: this is a project from one year ago that used to work !!!

using 2019r11 (still)

thanks.

should not possible but have u a Open event used in the CC template?

indeed the CC has a super, in which there is an open event, but it is not fired too. (and is raises the child open event if it runs !)

Are you able to replicate this in a new simple project that you can share?

2 Likes

as I said I found a workaround using the activate event to initialize my CC.
I will try to make a sample project, but I’m pretty sure that as always it will be impossible to reproduce the error …
I was asking here this question hopping someone has encountered the same problem at least ?

I’ve encountered problems using Open to do too much initialization because some controls or classes are in an unknown state. What I do now is create a Window superclass that, among other things, has an AfterOpen event.

The super implements Open and re-raises it to the subclass. It then starts a Timer with the minimum Period, and that Timer raises AfterOpen. By the time it fires, the Window has been fully formed, registered, painted, glossed, shellacked, or whatever else happens in the background.

4 Likes