This project is read-only.

AttachToEventHandler Method

Attach a cControl_EventHandler object's OnStartup / OnTerminate events or a cControl object's Startup_ / Terminate_ callbacks to a cControl_EventHandler object.



object A variable that represents a cControl / cControl_EventHandler object.


Name Required / Optional Data Type Description
EventHandler Required iControl_EventHandler Reference to an event handler object, cast as the generic interface type.


This function serves to attach a control's local Startup_ and Terminate_ member callback functions to it's corresponding cControl_EventHandler object's OnStartup / OnTerminate events. In the case of a cControl_EventHandler object attaching to another cControl_EventHandler object, the object being attached to is typically the cControl_EventHandler object for the parent form of the Composite / ActiveX control. In such cases, the control-level event handler's OnStartup / OnTerminate events are typically attached to the form-level event handler's OnLoad / OnClose events.


'This example attaches a Composite Control cControl object to it's corresponding event handler:

WebButtonControl.AttachToEventHandler WebButtonControlEventHandler

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


No comments yet.