C# generics usercontrol

Toto picture Toto · Aug 25, 2009 · Viewed 19.9k times · Source

I would like to define the following control:

public partial class ObjectSelectorControl<T> : UserControl where T : class 

The problem is that the designer can't resolve this. Is there a workaround to this issue?

Answer

P.K picture P.K · Aug 25, 2009

This works

public class Control1<T> : UserControl { ... }

public class Control2 : Control1<double> { ... }

public class Control3 : Control2 { ... }

had read it here:

Generic User Controls?