You may wonder why we need the
InitProperties event since the
UserControl property already has an
Initialize event in common with Class
modules and other objects, such as forms.
The reason that we need InitProperties to initialize default
values is that the Initialize event happens too often, that is, every
time an instance or your control "wakes up." You only want the default property
values to be assigned when the developer first sites a new copy of your control on a container.
After that, you want the developer to be able to define persistent property values.
WARNING - Don't Use the
Initialize Event to Set an ActiveX Control's Default Property
Values : If you put code to initialize properties to their default values
in your custom ActiveX control's Initialize event instead of in the
InitProperties event, then you will have some very frustrated developers
on your hands. Your default values will override the values the developer has
assigned at design time every time the developer runs an application using your
control.