如何清除Button的所有Click事件
FieldInfo keyfi = typeof(Control).GetField("EventClick", BindingFlags.Static | BindingFlags.NonPublic);
object eventkey = keyfi.GetValue(button1);
// Get the protected Events property
PropertyInfo evtpi = typeof(Control).GetProperty("Events", BindingFlags.Instance | BindingFlags.NonPublic);
EventHandlerList evts = (EventHandlerList)evtpi.GetValue(button1, null);
// Obtain the value of the delegate and remove it
Delegate dlg = evts[eventkey];
evts.RemoveHandler(eventkey, dlg);
object eventkey = keyfi.GetValue(button1);
// Get the protected Events property
PropertyInfo evtpi = typeof(Control).GetProperty("Events", BindingFlags.Instance | BindingFlags.NonPublic);
EventHandlerList evts = (EventHandlerList)evtpi.GetValue(button1, null);
// Obtain the value of the delegate and remove it
Delegate dlg = evts[eventkey];
evts.RemoveHandler(eventkey, dlg);
正面猛男