I have a solution with a VB.NET ProjectA Vb.net, and a C# ProjectB.
ProjectA has Form1.vb ProjectB has Form1.cs and ClassBB.cs
Start project is ProjectA and Form1.vb starts with this declaration:
Public WithEvents PB As New ProjectA.Form1
And with this, i take the event:
Private Sub arrived() Handles PB.MatchFound
' stuff to do
end sub
In Form1.cs:
public event EventHandler MatchFound;
protected void OnMatchFound()
{
if (MatchFound!= null)
MatchFound(this, EventArgs.Empty);
}
I can fire this event from any place in Form1.cs in ProjectB. Form1.cs also has in order to call some functions in ClassBB:
ClassBB ClassBB;
MyClassBB = new ClassBB();
I need to fire OnMatchEvent from ClassBB in order to receive the event in Form1 in ProjectA.
If i raise the event from Form1.cs from a function in ProjectB all work ok. But i don't know how to fire the event from a function inside ClassBB.
How to do this?