Hello, is there a way to create a single event handler for multiple instances of one object?
For example, I have a custom class "myObject" that contains one event that is fired through some user input. Then I create an array of objects:
For example, I have a custom class "myObject" that contains one event that is fired through some user input. Then I create an array of objects:
VB.NET:
class myObject
public event someEvent
end class
'---------------------------
class form1
dim obj() as myObject
dim o1 as new myObject
dim o2 as new myObject
sub Form1_Load
redim obj(1)
obj(0)=obj1
obj(1)=obj2
end sub
sub handleEvent
'I want to have some code here that reacts to firing "someEvent" event of
'any of the object instances in the obj() array
end sub
end class