Find all event handlers for a Windows Forms control in .NET

后端 未结 3 1039
余生分开走
余生分开走 2020-12-20 03:24

Is there a way to find all event handlers for a Windows Forms control? Specifically statically defined event handlers?

3条回答
  •  清酒与你
    2020-12-20 03:52

    Windows Forms controls use an EventHandlerList property called Events to hold event handlers so you could iterate that collection. To determine which subscribed handlers are static, you will need to use reflection.

提交回复
热议问题