“事件处理程序”是相应事件发生时调用的过程。您可以将任何带有匹配签名的有效子例程用作事件处理程序。可是,不能将函数用作事件处理程序,因为它不能将值返回给事件源。
在看MSDN帮助的时候看到的这句话,不理解,函数不能用作事件处理程序吗?
带有匹配签名的有效子例程不是函数吗

解决方案 »

  1.   

    原文如下:Event handlers are procedures that are called when a corresponding event occurs. You can use any valid subroutine with a matching signature as an event handler. You cannot use a function as an event handler, however, because it cannot return a value to the event source.
      

  2.   

    关于 Event Handler 的使用, 我自认为没有任何问题, 但看到这段话, 感觉还是不知所云subroutine 跟 function 有什么区别? return a value to the event source 又指什么? event 本来就不需要返回值, event 只是负责发布事件而已, 至于如何返回事件处理结果, 不是该它管的感觉是写这个文档的人自己就没搞明白吧, 所以随便糊弄了一篇文章出来