T
ThunderMusic
Hi,
I have a class let's say class1 that raises an event, let's say OnEvent.
In another class, let's say class2, I have an array of Class1. I want to be
able to trap the events fired by class1 within class2 and know (if possible)
the index of the class1 that fired the event. Is there a way? because
withevents does not work.
Here is some code you could rely on if you don't understand what I just
explain :
Class Class1
public event OnEvent()
End Class
Class Class2
private m_MyArray(10) as Class1 'WithEvents doesn't work, so I don't
write it
End Class
So, what should I do from there to catch the events fired by class1 into
class2? I figured it could be with AddHandler, but I'd have to store the
index in Class1 and I don't want to do that if possible. If it's the only
way, I'll do it this way, but I want to know if there is a better way.
Thanks
ThunderMusic
I have a class let's say class1 that raises an event, let's say OnEvent.
In another class, let's say class2, I have an array of Class1. I want to be
able to trap the events fired by class1 within class2 and know (if possible)
the index of the class1 that fired the event. Is there a way? because
withevents does not work.
Here is some code you could rely on if you don't understand what I just
explain :
Class Class1
public event OnEvent()
End Class
Class Class2
private m_MyArray(10) as Class1 'WithEvents doesn't work, so I don't
write it
End Class
So, what should I do from there to catch the events fired by class1 into
class2? I figured it could be with AddHandler, but I'd have to store the
index in Class1 and I don't want to do that if possible. If it's the only
way, I'll do it this way, but I want to know if there is a better way.
Thanks
ThunderMusic