Deactivate

Syntax

Private Sub object_Activate( )

Private Sub object_Deactivate( )

The object placeholder represents an object expression that evaluates to an object.

Remarks

An object can become active by user action, such as clicking it, or by using the Show or SetFocus methods in code.

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

The Activate and Deactivate events occur only when moving the focus within an application. Moving the focus to or from an object in another application does not trigger either event. The Deactivate event does not occur when unloading an object.

The Activate event occurs before the GotFocus event; the LostFocus event occurs before the Deactivate event.