title: Generic base class for WinForm UserControl
body: <p>I created a generic base class for a WinForm UserControl:</p>
  
  <pre><code>public partial class BaseUserControl&lt;T&gt; : UserControl
  {
      public virtual void MyMethod&lt;T&gt;() 
      { 
          // some base stuff here 
      }
  }
  </code></pre>
  
  <p>And a UserControl based on that:</p>
  
  <pre><code>public partial class MyControl : BaseUserControl&lt;SomeClass&gt;
  {
      public override void MyMethod&lt;SomeClass&gt;() 
      { 
          // some specific stuff here 
          base.MyMethod&lt;SomeClass&gt;();
      }
  }
  </code></pre>
  
  <p>It works fine, but MyControl cannot be edited in the VisualStudio Designer, because it says it cannot load the base class.
  I tried to define another class BaseUserControl, non generic, hoping it would load it, but the trick doesn't seem to work.</p>
  
  <p>I already have a workaround: define an interface, IMyInterface&lt;T&gt;, and then create my control as </p>
  
  <pre><code>public partial class MyControl : UserControl, IMyInterface&lt;SomeClass&gt;
  </code></pre>
  
  <p>But I lose my base virtual methods (not a big deal, but still...).</p>
  
  <p>Is there a way to create a base generic class for a UserControl, with the possiblity to edit it in the VisualStudio Designer?</p>