How can I get an actual EventHandler delegate instance from an event in VB.NET?

前端 未结 2 843
刺人心
刺人心 2020-12-20 15:51

In C#, I could do something like this:

EventHandler handler = this.SomeEvent;

...which would allow me to, for example, do:

         


        
2条回答
  •  悲哀的现实
    2020-12-20 16:41

    if you take a look at this How to Attach the Events of an Original Object to a Deep Copied Clone I have a code example on how to get the delegate for the event via reflection. As far as I know, its the only way to do it in VB.

提交回复
热议问题