activate
activate();
The activate event of the Form class occurs when a form becomes the active window.
When an MDI frame containing MDI child forms is made active, the MDI frame and the active child both receive activate events (in that order).
When moving between child forms of an MDI frame, only the child forms receive an activate event. Similarly, if the last active child is destroyed, the MDI frame does not receive another activate event, as it is already active.
A form can become active by a user action, such as clicking a form or control, or by using the show or setFocus method in logic.
The activate event occurs only when a form is visible. For example, after a form loaded is created, it is not visible unless you use the show method or set the visible property of the form to true. The activate event occurs when moving the focus within an application (including MDI to non-MDI) and also to another application.
The method in the following example shows the use of the activate event.
activate() updating; begin lCount.caption := theCollectionSize.String; self.resize; end;
The handling of activate and deactivate events ensures that the following events occur once only.
-
deactivate of the prior active form.
-
deactivate of the MDI frame of the prior active form if it was an MDI child and the new form gaining focus is not the MDI frame or a child of the MDI frame.
-
activate of the MDI frame if the form to be activated is an MDI child and the frame is not already active.
-
activate of the form to be activated.
If another Windows or JADE application is activated while a JADE application is active, only deactivate events are generated for the deactivated JADE application.
If a JADE application is activated when another Windows or JADE application is active, only the activate events are generated for the activated JADE application.