AttachToEventHandler Method


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

Syntax

object.AttachToEventHandler(EventHandler)

object A variable that represents a cControl / cControl_EventHandler object.

Parameters

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

Remarks

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.

Example

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

WebButtonControl.AttachToEventHandler WebButtonControlEventHandler

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

Comments

No comments yet.