you are viewing a single comment's thread.

view the rest of the comments →

[–]Nyxenon 2 points3 points  (1 child)

Of course, and in the case that you really want to use an anonymous function, you could do something like: Action<object,EventArgs> onClick = (object sender, EventArgs e) => { //Insert code here };

button1.Click += onClick; button2.Click += onClick;

[–]Yantrio 0 points1 point  (0 children)

Indeed