G
Guest
I am trying to create a generics class with multiple constrains, as follows:
public class KeyHandler<T> where T : TextBoxBase, ComboBox
When I try that, the compiler would complain:
The class type constraint 'System.Windows.Forms.ComboBox' must come before
any other constraints
If I switch place of ComboBox with TextBoxBase, it would gripe:
The class type constraint 'System.Windows.Forms.TextBoxBase' must come
before any other constraints
Is it possible to create such a generics class? Tks.
public class KeyHandler<T> where T : TextBoxBase, ComboBox
When I try that, the compiler would complain:
The class type constraint 'System.Windows.Forms.ComboBox' must come before
any other constraints
If I switch place of ComboBox with TextBoxBase, it would gripe:
The class type constraint 'System.Windows.Forms.TextBoxBase' must come
before any other constraints
Is it possible to create such a generics class? Tks.