<p>You should be able to create a generic form:</p>

<pre><code>public partial class MyGenericForm&lt;T&gt; :
    Form where T : class
{
    /* form code */
    public List&lt;T&gt; TypedList { get; set; }
}
</code></pre>

<p>Is valid C#, and compiles.  However the designer won't work and the form will throw a runtime exception if you have any images stating that it cannot find the resource.</p>

<p>I think this is because the windows forms designer assumes that the resources will be stored under the simple type's name.</p>

[{'answer_id': 10906, 'author': 'Keith', 'author_id': 905, 'author_profile': 'https://Stackoverflow.com/users/905', 'pm_score': 0, 'selected': False, 'text': "<p>I have a hack to workaround this, which works but isn't ideal:</p>\n\n<p>Add a new class to the project that inherits the form with its simple name.</p>\n\n<pre><code>internal class MyGenericForm:\n    MyGenericForm&lt;object&gt; { }\n</code></pre>\n\n<p>This means that although the designer is still wrong the expected simple type (i.e without <code>&lt;&gt;</code>) is still found.</p>\n"}, {'answer_id': 10907, 'author': 'Matt Hamilton', 'author_id': 615, 'author_profile': 'https://Stackoverflow.com/users/615', 'pm_score': 5, 'selected': True, 'text': '<p>Yes you can! Here\'s a blog post I made a while ago with the trick:</p>\n\n<p><a href="http://www.madprops.org/blog/designing-generic-forms/" rel="noreferrer">Designing Generic Forms</a></p>\n\n<p>Edit: Looks like you\'re already doing it this way. This method works fine so I wouldn\'t consider it too hacky.</p>\n'}, {'answer_id': 57163033, 'author': 'Ali Osman Yavuz', 'author_id': 6342642, 'author_profile': 'https://Stackoverflow.com/users/6342642', 'pm_score': 0, 'selected': False, 'text': '<p>You can do it in three steps.</p>\n\n<p>1) Replace in Form1.cs File</p>\n\n<pre><code>public partial class Form1&lt;TEntity, TContext&gt; : Formbase // where....\n</code></pre>\n\n<p>2) Replace in Form1.Designer.cs</p>\n\n<pre><code> partial class Form1&lt;TEntity, TContext&gt;\n</code></pre>\n\n<p>3) Create new file : Form1.Generic.cs (for opening design)</p>\n\n<pre><code>partial class Form1\n{\n}    \n</code></pre>\n'}, {'answer_id': 60053845, 'author': 'Nando', 'author_id': 2139449, 'author_profile': 'https://Stackoverflow.com/users/2139449', 'pm_score': 0, 'selected': False, 'text': "<p>If paleolithic code doesn't affraid you</p>\n\n<pre><code>    public  static MyForm GetInstance&lt;T&gt;(T arg) where T : MyType\n{\n    MyForm myForm = new MyForm();\n\n    myForm.InitializeStuffs&lt;T&gt;(arg);\n    myForm.StartPosition = myForm.CenterParent;\n\n    return myForm;\n}\n</code></pre>\n\n<p>Use it </p>\n\n<pre><code>var myFormInstance = MyForm.GetInstance&lt;T&gt;(arg);                                                                      myFormInstance.ShowDialog(this);\n</code></pre>\n"}]
['https://Stackoverflow.com/questions/10905', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/905/']