VB.net event handling problem

KaiserBreath

Senior Member
Joined
Feb 22, 2005
Messages
1,031
Reaction score
209
Hi all again.

Assuming I have some class:

public Class A
Public Event Changed()
...
End Class

Public Class B
Friend WithEvents my_A As A

Public Event B_RaiseChanged()

Public Sub B_Changed() Handles my_A.Changed
RaiseEvent B_RaiseChanged()
End Sub
...
End Class

Public Class C
Dim B1 As B = New B
Dim B2 As B = New B

Public Sub HandleB1() Handles B1.B_RaiseChanged
...
End Sub

Public Sub HandleB2() Handles B2.B_RaiseChanged
...
End Sub
End Class

However, when the event is raised, it goes into both HandleB1 and HandleB2. How should I do so that they will go to their unique functions?

Thanks!
 
Important Forum Advisory Note
This forum is moderated by volunteer moderators who will react only to members' feedback on posts. Moderators are not employees or representatives of HWZ Forums. Forum members and moderators are responsible for their own posts. Please refer to our Community Guidelines and Standards and Terms and Conditions for more information.
Top