I wanted to give a more specific answer as a complement to Adam's message .
BaseForm is the name of your generic form; GenericClass one of the possible type parameters.
BaseForm<T> might look like this:
public class BaseForm<T> : Form { }
First you need a base class. This is actually the part that you probably already used before you came across this issue.
Then you use this intermediate implementation.
public class SampleFormIntermediate : BaseForm<GenericClass> { public SampleFormIntermediate() { InitializeComponent(); } }
And you need to use this class for the designer of Visual Studio. And only that. I would recommend decorating this with the compiler directive, so it will only be used in Debug mode:
public partial class SampleForm : SampleFormIntermediate { }
Using this Visual Studio "understands" what to open in the designer and how to open it.
Patrick hofman
source share