OK, you are given some useful links by Maceiej. Let me give you some bottom line. Basically, you apply "+=" operators to each instance of the button once or more to add some
event handlers to add to the
invocation list of the
Click
event of each. Each event handler is itself an instance of the delegate of appropriate method
signature. I would recommend using
anonymous methods in all cases. You can combine sharing of the same handlers by different instances of control with individual handlers. This is totally up to you:
myButton.Click += (sender, eventArgs) => {
someSharedMethod();
}
myOtherButton.Click += (sender, eventArgs) => {
ToolStripButton button = (ToolStripButton).sender;
someSharedMethodDepedingOnControlInstance(button);
}
myYetAnotherButton.Click += (sender, eventArgs) => {
someIndividualMethod();
}
As you can see, using anonymous methods adds some flexibility: you don't need to create special handler method with both parameters, as one or both of them are often unused. Now decide what to do with all that by yourself, depending on your code design.
[EDIT]
If you are confused with my note on closures (which is likely, please see above), please also see:
http://en.wikipedia.org/wiki/Closure_%28computer_science%29#Delegates_.28C.23.2C_D.29[
^].
—SA