This project is read-only.

CreateEventHandler Method

Manages the creation of a cControl_EventHandler object.


object.CreateEventHandler(ctl, ControlType, AttachToParent, ParentControlType)

object A reverence to a valid class instance.


Name Required / Optional Data Type Description
AttachToParent Optional Boolean Indicates whether or not the event handler ought to have it's Startup / Terminate events attached to its parent. Default is True.
ControlType Required ccControlType Type of event handler control to create.
ctl Optional Object Reference to the control for which a cControl_EventHandler object will be instantiated.
ParentControlType Optional ccControlType Type of parent control to attach the event handler to. Default is ccForm.


CreateEventHandler handlers basic initialization and AttachToParent assignment. Returns the new event handler object cast as the generic interface type, iControl_EventHandler.

ParentControlType allows the new event handler to attach it's Startup / Terminate events to something other than a form's OnOpen / OnClose, if desired.


This example creates a cControl_EventHandler object for an AcitveX ComboBox control and returns it.

Dim eh As cControl_EventHandler_ComboBox

Set eh = myCompositeControls.CreateEventHandler ([Form_myForm].myCombo1, ccComboBox_EventHandler)

Last edited Dec 26, 2010 at 1:25 AM by vba_junkie, version 1


No comments yet.