Hi Rob,
Let me know if this helps.
'VB
Delegate Function MyFunctionDelagate(ByVal data As Short) As Integer
Class TestClass
Public Sub New(ByVal myFunc As MyFunctionDelagate)
End Sub
End Class
Public Function MyFunction(ByVal data As Short) As Integer
Return 0
End Function
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles MyBase.Load
Dim m1 As New TestClass(New MyFunctionDelagate(AddressOf Me.MyFunction))
End Sub 'Form1_Load
//C#
public delegate int MyFunctionDelagate(short data);
class myClass
{
public myClass(MyFunctionDelagate myFunc)
{
}
}
public int MyFunction(short data)
{
return 0;
}
private void Form1_Load(object sender, System.EventArgs e)
{
myClass m1 = new myClass(new MyFunctionDelagate(this.MyFunction));
}