How can I know if a .net event is already handled?

前端 未结 8 2133

I\'ve written some code to handle an event as follows:

AddHandler myObject.myEvent, AddressOf myFunction

It seemed that everything was work

8条回答
  •  失恋的感觉
    2020-12-31 10:10

    There's no way to tell that a handler is already attached but you can safely call RemoveHandler on the event before calling AddHandler. If there isn't already a handler, RemoveHandler will have no effect.

提交回复
热议问题