In C# I can test for this...
public event EventHandler Trigger;
protected void OnTrigger(EventArgs e)
{
if (Trigger != null)
Trigger(this, e);
}
I believe the syntax I use for this in VB.Net is:
Public Event Trigger As EventHandler
Friend Sub OnTrigger(ByVal e As EventArgs)
If TriggerEvent IsNot Nothing Then
RaiseEvent Trigger(Me, e)
End If
End Sub
Even though TriggerEvent does not appear to be declared the compiler will understand it.It closer emulates the C# syntax. Also I have read somehere that the code with that handler asssigned check runs fater, but I cannot point to that at the moment, so youcan take or leave that.
I think that is the sytax, anyway. Please dont shoot me if it is not quite correct!