From I’ve been told, adding an event handler does just that. It adds to handler, and doesn’t replace it.
The following code uses the +=
to add an event handler to the existing object:
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
Had it used "="
, then it would have probably replaced any existing event handlers. That might also cause an issue when the native disposal "-="
is called and there isn’t a matching eventhandler in the object.
And while it’s just a guess, I believe the event handlers fire in order they were added to the object. So any native event handler would fire first, and then the one you added.