To create a new event handler on a control you can do this
c.Click += new EventHandler(mainFormButton_Click);
or this
c.Cli
From Removing All Event Handlers:
Directly no, in large part because you cannot simply set the event to null.
Indirectly, you could make the actual event private and create a property around it that tracks all of the delegates being added/subtracted to it.
Take the following:
List
delegates = new List (); private event EventHandler MyRealEvent; public event EventHandler MyEvent { add { MyRealEvent += value; delegates.Add(value); } remove { MyRealEvent -= value; delegates.Remove(value); } } public void RemoveAllEvents() { foreach(EventHandler eh in delegates) { MyRealEvent -= eh; } delegates.Clear(); }