Purpose : The Activate event fires when a form, MDI form , or data report becomes the active window in an application.
Syntax :
Sub Form_Activate ( )
Sub MDIForm_Activate ( )
Sub DataReport_Activate ( )
An object can become active by a user action such as clicking the object or by using the Show or SetFocus method in code. The activate event can occur only when an object is visible . A form loaded with the Load statement , for example , isn't visible unless you use the Show method or set the form's Visible property to True. The Activate event occurs only when moving the focus within an application. Moving the focus to or from an object in another application doesn't trigger the event.
The Deactivate Event :
the Deactivate and Activate events have an inverse relationship. Whereas the Activate eent occurs when a form becomes active , the Deactivate event occurs when a form is no longer active. The Deactivate event occurs only when moving the focus within an application. Moving the focus to or from an object in another application doesn't trigger either event. The Deactivate event doesn't occur when unloading an object.
The LostFocus event occurs before the Deactivate event.
No comments:
Post a Comment