Raise event from Collection member?? 
Author Message
 Raise event from Collection member??

Hi all,

I'm in over my head here, so I could use some advice from a VB guru.  I need
to be able to dynamically create n objects (from one of my own classes), and
add them to a collection to keep track of them.  Is there any way to capture
an event from one of these objects without maintaining a global or module
level variable that references each one?  What I'm trying to do is similar
to the way members of a control array share event procedures and pass in an
index to indicate which member of the control array raised the event.

Thanks in advance,

Dave Clipsham
Bloomfield & Grossart, Inc.



Mon, 01 Jul 2002 03:00:00 GMT  
 Raise event from Collection member??
Dave
The WithEvents Statement will not work with a control array or object in a
collection. It requires a one to one relationship with an Object. If you
are going to have many objects in a collection a better method may be to
use callbacks. This way you can pass every class you create an interface to
call back into. So instead of raising and event it would just call a method
in the callback class. You could use the same object instance for all the
class objects in the collection.

Thanks
Brian Combs
Microsoft Developer Support for Visual Basic



Fri, 05 Jul 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

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

2. Raising events from objects in a collection

3. Raising events from objects in a collection

4. Raising events from a class within a collection class

5. Raising events from objects in a collection

6. Objects in Collection and Raise Events

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

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

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

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

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

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

 

 
Powered by phpBB® Forum Software