Events Property


Returns a collection of cControlChild_Event objects instanced in a cControl_EventHandler object. Read-only Collection

Syntax

object.Events(index)

object: A reference to a cControl_EventHandler class instance.

Parameters

index: Variant value corresponding to either the index position of the cControlChild_Event object in the collection, or the name of the object (e.g., "OnClick", "AfterUpdate", "OnChange", etc.)

Remarks

The Events collection allows for iteration of all events of any given cControlEventHandler. The collection method also allows for access to events specific to a particular cControlEventHandler object through the generic iControl_EventHandler interface.

This method of accessing an event handlers cControlChild_Event objects is inferior to directly accessing the objects.

Example

This example iterates all events in a cControlEventHandler object cast as a generic iControlEventHandler instance.

Dim iHandler as iControl_EventHandler
Dim evt as cControlChild_Event

'reference a cControl_EventHandler_ComboBox object as a generic iControl_EventHandler object
Set iHandler = myComboboxEventHandler

For Each evt In iHandler.Events

     MsgBox "Event Name: " & evt.Name

Next evt

Last edited Dec 20, 2010 at 2:20 AM by vba_junkie, version 1

Comments

No comments yet.