I’ve got the following Generic usercontrol declared:
public partial class MessageBase<T> : UserControl { protected T myEntry; public MessageBase() { InitializeComponent(); } public MessageBase(T newEntry) { InitializeComponent(); myEntry = newEntry; } } }
But the compiler won’t allow me to do this:
public partial class MessageControl : MessageBase<Post> { public MessageControl() { InitializeComponent(); } }
How do I create a generic user control in C#?
Try this
The key to getting the designer to work is that the base class of the class you are editing must not be generic.