I’ve got two lines of code I’ve worked with:
textBox_ssn.KeyDown += ButtonSS;
textBox_ssn.AddHandler(Control.KeyDownEvent, new KeyEventHandler(ButtonSS), true);
As far as I can tell they both work in the same way, but is there something different going on behind the scenes.
With AddHandler you can add the same handler for the same event multiple times without throwing an exception. However, the manager is actually called several times when the event is handled.
Therefore, consider how this behavior can have side effects that should be explained in your handler implementation.