Visual Basic Reference

Visual Studio 6.0

Terminate Event

See Also    Example    Applies To

Occurs when all references to an instance of a Form, MDIForm, User control, Property Page, Webclass, DHTML Page Designer, or class are removed from memory by setting all the variables that refer to the object to Nothing or when the last reference to the object falls out of scope.


Private Sub object_Terminate( )

The object placeholder represents an object expression that evaluates to an object in the Applies To list.


For all objects except classes, the Terminate event occurs after the Unload event.

The Terminate event isn't triggered if the instances of the form or class were removed from memory because the application terminated abnormally. For example, if your application invokes the End statement before removing all existing instances of the class or form from memory, the Terminate event isn't triggered for that class or form.