سؤال

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?

هل كانت مفيدة؟

المحلول

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

You wouldn't do

Return(x)
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top