How to receive events from multiple objects in an array??

pvkiran

New member
Joined
Jul 19, 2006
Messages
4
Programming Experience
1-3
Somebody please get me outta this.
I have a custom class say "X" which has an event. I have a form module
in which i have to instantiate multiple objects of the class "X". So I
have tried adding multiple objects of the type "X" to a collection and
array in the form module but i am not able to receive the events of the
instances in the form.
I am able to receive events only for a single variable like
Protected Withevents Obj as clsX
I am not able to receive events when i say
protected objCol as collection or
protected objArr() as clsX
Can soneone tell me how to do this??

Thankx
PVKiran
 
You have to use the AddHandler statement. Example:
VB.NET:
AddHandler objArr(234).theEvent, AddressOf theEventhandler
 
Back
Top