繁体   English   中英

对用户控件使用带有类型参数的基类

[英]Using a base class with a type parameter for a User Control

我有一个用户控件,使用带有类型参数的基类似乎不喜欢我。 我有什么办法解决这个问题吗?

public partial class PopupSelector : PopupSelectionControl3<int>
{
    public PopupSelector()
    {
        InitializeComponent();
    }
}

... Plus the designer code ...

public class PopupSelectionControl3<TValue> : XtraUserControl
{
}

WinForms设计器不能很好地应对通用的UserControl。

bernhardrusch 在此处提供了一种解决方法

public partial class UserControl : UserControlDesignable  {  ... } 

public class UserControlDesignable : BaseUserControl<Someclass> { } 

有关解决方法的更多详细信息,请参见此处

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM