Hide Event (UserDocument Object)

       

Occurs when the object’s Visible property changes to False.

Syntax

Sub object_Hide()

The Hide event syntax has these parts:

Part Description
object An object expression that evaluates to an object in the Applies To list.

Remarks

In order to draw to the screen in Windows, any object must have a window, temporarily or permanently. Visual Basic ActiveX documents have permanent windows. The UserDocument object receives Hide events when the window is removed.

While object’s window is on the container, object receives a Hide event when object’s Visible property changes to False.

Object does not receive Hide events if the container is hidden and then shown again, or if the container is minimized and then restored. Object’s window remains on the container during these operations, and its Visible property doesn’t change.

If object is being shown in an internet browser, a Hide event occurs when the page is moved to the history list by navigating off object to another document, or when Internet Explorer 3.0 is terminated while object is being viewed or is still within the cache of active documents. Use the event to destroy any global object references before navigating to another document.

Note   If object is used with earlier versions of Visual Basic than 5.0, object will not receive Hide events at design time. This is because earlier versions of Visual Basic did not put any visible windows on a form at design time.