views:

52

answers:

1

How can I put AddressOf, from another class?
I get this error 'AddressOf' operand must be the name of a method (without parentheses). "

Is there an Eval () function in VB.NET? Or how does one do this?

Public Shared Property e As UserControl

Public Shared Sub SetButton(ByVal button As String, ByVal Objekt As [Delegate])

    Dim errorbuttom1 As Button = e.FindName("errorButton1")

    AddHandler errorbuttom1.Click, AddressOf Objekt

End Sub
A: 

Hey,

You have to have an instance of Objekt, and the method that's the delegate must be public and match the signature of the delegate. Or, the method must be public static.

I believe that would work...

Brian