Does anyone know if there is a way to get the sender and eventarguments passed to the event when using the built-in delegate like below?
p.Click+=delegate { //do some stuff };
Well, you can declare this:
p.Click += delegate (object sender, EventArgs args) {...}
and use them as sender and args .
sender
args
Or with lambdas:
p.Click += (sender, args) => {...}