When writing a program that has a lot of dynamic controls in it, you have to be careful with registering event handlers onto them. I discovered this the difficult way when one of my applications was registering multiple 'Click' events on a button. This was happening because I was binding a new event on it every time without cleaning up the old ones - so a new Click would trigger all the previous events. This handy little code snippet cleans up all the Click events on a Button so that you can then add a new event handler without any fear!
This work was part of my industrial placement. I worked in the DAC (Digital to Analog Converters) department under Maurice Egan.