Load Event

Object List Next Object

Defined By:
Form

Description:

Takes place when a form is loaded.

Usage:

Sub Load()

Details:

The Load event procedure is used most often to initialize information for the form. For example, you may need to insert the lists in combo and list boxes, provide information in a text box, set controls to their defaults, initialize any form-related variables, or prompt for user input. The Load event can also initialize default path information for file, drive, and directory boxes.

There are three ways in which a form's load event can be initiated. One, when an application loads forms at startup. Two, when a form is loaded using a Load statement. Three, as the result of any changes or references made to the properties or control's of an unloaded form. Regardless of how a form is loaded, it is not displayed until you use the Show method or set the Visible property to True.


Note: You must be careful when creating procedures that attach more than one of the following events to a single control: Activate, GotFocus, Load, Paint, and Resize. To ensure that their actions don't conflict or cause recursive events, you should keep in mind that the order of precedence used for processing these events is: Load, Resize, Paint, then GotFocus.

See Also:

Load event, Unload event, UnloadForm method