Export (0) Print
Expand All

Visual Basic Reference

Visual Studio 6.0

Initialize Event

See Also    Example    Applies To

Occurs when an application creates an instance of a Form, MDIForm, User control, Property Page, Webclass, DHTML Page Designer, or class.


Private Sub object_Initialize( )

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


You trigger the Initialize event when you:

  • Use the CreateObject function to create an instance of a class. For example:
    Set X = CreateObject("Project1.MyClass")
  • Refer to a property or event of an automatically created instance of a form or class in your code. For example:
    MyForm.Caption = "Example"

Use this event to initialize any data used by the instance of the Form, MDIForm, or class. For a Form or MDIForm, the Initialize event occurs before the Load event.

© 2014 Microsoft