I created a custom control using a Container Control to hold all the bits.
To the CC I added Open and Resize events…
The Resize event is called as desired… but the Open event is NEVER called… I even put breakpoints to be sure.
If I add an Activate event… it is called, but not the Open…
Constructor method is called, so maybe I will use that unless someone can tell me I did something wrong
I did something similar last week. App started crashing when closing the database. Stupid me had added a disconnect and then the app talked to the database again. Took me quite a while to understand what I had done.
If memory serves (and it doesn’t always), the Open event is the last thing that fires indicating that everything is done and ready for business. In the open event set a boolean variable for Initialized and in your computed properties you might want do a check that variable before sending commands to controls.
Yeah that is what I’m working on right now… something I just changed has it going into an infinite loop… if it isn’t one issue its another …
And it has to be something with the Computed Properties… as I have found it is skipping the Open events of all the controls that are INSIDE the CC as well.
I have seen this where a Container’s open event never fires. I know I’ve seen it in WebContainers, but I think in Desktop as well. I believe I may have an open bug report on this - I’ll have to look.
Question: Are you placing the container in the window or are you creating the container and using EmbedWithin
I think that placing it in the window in the IDE is problematic. I now embed my containers in code 100% of the time. In those cases, the open event seems to fire reliably.
OK. So you are embedding it. That’s strange. Check for some sort of exception in the Constructor or in one of the controls in the container. I’ve seen that which then aborts the constructor code from running and the Open event never gets called.