OnActivate Event (AForm)

Occurs when the form becomes the active window.

Syntax

Object.OnActivate()

The OnActivate event syntax has the following parts:

 

Name

Type

Description

Object

AForm

AForm object

Comments

The Active window is the window that appears in the foreground with a highlighted title bar or border to distinguish it from other visible windows. A form can become active by user action, such as clicking it, or by using SetFocus method in code.

The OnActivate event can occur only when an object is visible. For example, a form loaded with the Load statement is not visible unless you set form's Visible property to True.

The OnActivate event occur only when moving the focus within an application. Moving the focus to a from in another application does not trigger either event.

The OnActivate event occurs before the OnGotFocus event.

The event occur for MDI child forms only when the focus changes from one child form to another. In an MDIForm object with two child forms, for example, the child forms receive the event when the focus moves between them. However, when the focus changes between a child form and a non-MDI child form, the parent MDIForm receives the OnActivate and OnDeactivate events.

If an .exe file built by ATEasy displays a dialog box created by a .dll file also built in ATEasy, the .exe file's form will get the OnDeactivate and OnLostFocus events. This may be unexpected, because you should not get the OnDeactivate event.

Example

Procedure MyForm.OnActivate(): Void Public

{

  Caption="I'm active"

}

Applies to

AForm

See Also

Load, MDIActiveForm, OnDeactivate, OnGotFocus, OnInitialize, OnLostFocus, Visible