Is it Possible to Make a Generic Control in .Net 3.5?

后端 未结 4 1590
渐次进展
渐次进展 2020-12-09 12:12

I\'ve got the following Generic usercontrol declared:

public partial class MessageBase : UserControl
    {
        protected T myEntry;
        publ         


        
4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-09 12:47

    For one, althought generic controls are possible under .NET, the Visual Studio designers do not support them, so you're on your own if you want to use them. You'll have to instantiate them yourself in your code and perform layout too.

    As for the error you mention, it sounds to me like you're looking in the wrong direction. Perhaps you could write the whole error text here?

提交回复
热议问题