var obj=new Button();
string eventName = "Click";
var evt = obj.GetType().GetEvent(eventName);
EventHandler myCode = delegate {MessageBox.Show("asd");};
evt.AddEventHandler(obj, myCode);
hi
I am adding event handler to button clicks event this code
click event has need to 2 parametr object sender and EventArgs e
How can i get EventArgs e parametr in this code?
If you mean “in the handler”, then:
or more dense as a lambda:
If you mean “when invoking the event”, use
objandEventArgs.Empty.