How can I get the type of an event?
I have a checkbox and I want to know the type of e when CheckedChanged event is fired. c#
开发者_StackOverflow社区protected void CheckBox_CheckedChanged(object sender, EventArgs e)
every object in .net have method GetType()
to get type of it i.e method of the base class object which is get inherited by every type.
so to get the type of the event you can use
e.GetType()
method will give you type of your event.
Set an breakpoint at the event and quick watch e. The Type should be displayed
精彩评论