共用方式為


Unload Event

Occurs when an object is released.

PROCEDURE Object.Unload
[LPARAMETERS nIndex]

Parameters

  • nIndex
    Uniquely identifies a control if it is in a control array.

Remarks

The Unload event is the last event to occur before a form set or form is released. Unload occurs after the Destroy event and after all the contained objects have been released.

The occurrence of this event depends on the type of object:

  • Form objects are released in code when the object variable that refers to the form is released or when its form set is released.
  • form set objects are released in code when the object variable that refers to the form set is released.

If a container object, such as a form set, contains objects, the Unload event for the container object occurs after the Unload events for the objects it contains. For example, a form set containing one form that contains one control (a CommandButton) is released in this order:

  1. FormSet's Destroy event
  2. Form's Destroy event
  3. CommandButton's Destroy event
  4. Form's Unload event
  5. FormSet's Unload event

See Also

Destroy Event | QueryUnload Event | Destroy Event

Applies To: Form | FormSet