C# generics usercontrol

后端 未结 7 1082
梦如初夏
梦如初夏 2020-12-03 05:10

I would like to define the following control:

public partial class ObjectSelectorControl : UserControl where T : class 

The proble

7条回答
  •  萌比男神i
    2020-12-03 05:18

    I don't believe this is possible, because the designer invokes an instance of your class. If you use generics, the designer doesn't know what type to pass into 'T'.

提交回复
热议问题