windowCreated

windowCreated(cntrl:        Control input;
              persistCntrl: Control);

A windowCreated event of the Control class is called for all controls when the window for the control is created. This event is called before the load event for the Form class, so that you can initialize a control (for example, creating a child window) when the window for that control is present.

The cntrl parameter passes the event the control itself, and the persistCntrl parameter passes the control object from which the window was created (usually the persistent control object). This enables the event logic to clone any reference information that is also required by the control. (The runtime control is created by a shallow clone, and the primitive properties only are copied.)

Properties retrieved from the control object specified in the persistCntrl parameter reflect the persistent, not the transient, instance.

Avoid referring to user-defined properties or methods on the Application or Global classes in the windowCreated method or any methods called by the windowCreated method. When the form is displayed in the Jade Painter, the application used is not the user application, so these properties or methods are not available at run time. If the property or method must be referenced, the method must perform a runtime check to ensure that the application is the expected one; otherwise, an exception will be raised.