Why doesn’t the designer work if you inherit from an own written genericform?
Suppose I’ve got the following genericform
public class GenericForm<T> : System.Windows.Forms.Form { public T Test { get; set; } }
When I go to the designer I get errors.
The only workaround I made up is using compiler directives.
#if DESIGN public partial class Form1 : System.Windows.Forms.Form #else public partial class Form1 : GenericForm<string> #endif { public Form1() { InitializeComponent(); } }
I believe that’s because the designer tries to instantiate the form (or UserControl) to host it in the designer. If you have a generic (or abstract) form, the designer cannot instantiate it.