title: C# Inherit a Class within a Form
body: <p>I have been pulling my hair out for awhile </p>
  
  <p>I have created a form filled with pictureboxs. Each picturebox will contain a _click, _mousedown and _mouseup event. I wish to move these events created for the form into a class1.cs and then have form1.cs inherit these events.</p>
  
  <p>I do not wish to make the picturebox1 public. 
  so something such as 
  Class1 classOne = new Class1(); 
  pictureBox1.Click += new EventHandler(cs.pictureBox1_Click); will not work.</p>
  
  <p>I am unsure how to make form1.cs inherit class1.cs. sounds so easy in my head but im just at a mental blank</p>
  
  <p>I have tired class Form1 : Form, Class1</p>
  
  <p>in Form1.Designer.cs this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click); 
  this.pictureBox1_Click can not be accessed</p>
  
  <p>if you could point me in the right direct it will be a great help! Cheers</p>
  
  <pre><code>Form1.cs
  public partial class Form1 : Form
  {
      public Form1()
      {
          InitializeComponent();
      }
  }
  
  Class1.cs 
  class Class1
  {
  
      private void pictureBox1_Click(object sender, EventArgs e)
      {
          MessageBox.Show("pb1 click");
      }
   }
  </code></pre>