title: Winforms user controls custom events
body: <p>Is there a way to give a User Control custom events, and invoke the event on a event within the user control. (I'm not sure if invoke is the correct term)</p>
  
  <pre><code>public partial class Sample: UserControl
  {
      public Sample()
      {
          InitializeComponent();
      }
  
  
      private void TextBox_Validated(object sender, EventArgs e)
      {
          // invoke UserControl event here
      }
  }
  </code></pre>
  
  <p>And the MainForm:</p>
  
  <pre><code>public partial class MainForm : Form
  {
      private Sample sampleUserControl = new Sample();
  
      public MainForm()
      {
          this.InitializeComponent();
          sampleUserControl.Click += new EventHandler(this.CustomEvent_Handler);
      }
      private void CustomEvent_Handler(object sender, EventArgs e)
      {
          // do stuff
      }
  }
  </code></pre>