簡體   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