Raising events from objects in a collection??? 
Author Message
 Raising events from objects in a collection???

I solved the problem like this:
1. The collection object is a collection wrapper
2. The collection members have a reference to the collection
3. Implement 'Friend Sub NotifyDoorOpened(Door as objDoor)'  in the
collection wrapper class
4. RaiseEvent DoorOpened(Door) inside the Notifyxxx procedure
5. Collection members invoke the Notifyxxx procedure to raise the event

With that, a single controller object can receive events from all members
(a single WithEvents statement)

Hope this helps
Alex


Quote:
> Does anyone know of some type of routine to respond to events of objects
in
> a collection.
> For example:

> -objDoor is an object which has an "Opened" event
> -colDoors is a collection of objDoor objects

> To repond to the event with just an object, you would code:

> Sub objDoor_Opened()
> 'code when door has opened
> 'yadda yadda yadda
> End Sub

> But what if there were several - or several hundred - objDoor "items"
> (objects) in an objDoors collection, and one of them doors opened. How
would
> you respond to that?



Sat, 01 Mar 2003 21:13:26 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Raising events from objects in a collection

2. Raising events from objects in a collection

3. Raising events from objects in a collection

4. Raising events from objects in a collection???

5. Raising events from objects in a collection???

6. Raising events from objects in a collection???

7. Raising events from objects in a collection???

8. Raising events from objects in a collection???

9. Objects in Collection and Raise Events

10. Raising events from collection member objects?!?!

11. Raising events from a class within a collection class

12. Raise event from Collection member??

 

 
Powered by phpBB® Forum Software