Question

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?

Était-ce utile?

La solution

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

You wouldn't do

Return(x)
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top