title: How can I use a custom control class that inherits from a built-in control on my main form?
body: <p>I have a mydatagridview class which inherits from the built-in <code>DataGridView</code> control, as shown below:</p>
  
  <pre><code>public class mydatagridview : DataGridView 
  {
      protected override bool ProcessDataGridViewKey(KeyEventArgs e)
      {
          if (e.KeyCode == Keys.Enter) 
          {
              this.ProcessTabKey(e.KeyData);
              return true;
          }
          return base.ProcessDataGridViewKey(e);
      }
  
      protected override bool ProcessDialogKey(Keys keyData)
      {
          if (keyData == Keys.Enter) 
          {
              this.ProcessTabKey(keyData);
              return true;
          }
          return base.ProcessDialogKey(keyData);
      }
  }
  </code></pre>
  
  <p>Now I want to utilize it in my main class: </p>
  
  <pre><code>public partial class Form1 : Form
  {
      public Form1()
      {
          InitializeComponent();
      }
  }
  </code></pre>
  
  <p><strong>I want to Utilize myDatagridview with Datagridview1 of :    public partial class Form1 : Form</strong></p>
  
  <p>How can I do this?</p>