Domanda

In VB.net, I have to use AddHandler (to add handler function dynamically) without the brackets. However if I use brackets like:

AddHandler(MyBtn.Click, AddressOf MyBtn_Click)

It does not work. The call must be without brackets. Is there any equivalent syntax for calling AddHandler using brackets? Is AddHandler different from subroutine or a function (method) of some class?

È stato utile?

Soluzione

It's a statement, not a function call. Just like Return.

You wouldn't do

Return(x)
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top