title: Method to register method to be called when event is raised
body: <p>I have a Panel which contains 20 PictureBox controls. If a user clicks on any of the controls, I want a method within the Panel to be called.</p>
  
  <p>How do I do this?</p>
  
  <pre><code>public class MyPanel : Panel
  {
     public MyPanel()
     {
        for(int i = 0; i &lt; 20; i++)
        {
           Controls.Add(new PictureBox());
        }
     }
  
     // DOESN'T WORK.
     // function to register functions to be called if the pictureboxes are clicked.
     public void RegisterFunction( &lt;function pointer&gt; func )
     {
          foreach ( Control c in Controls )
          {
               c.Click += new EventHandler( func );
          }
     }
  }
  </code></pre>
  
  <p>How do I implement <code>RegisterFunction()</code>?
  Also, if there are cool C# features that can make the code more elegant, please share.</p>