【发布时间】:2010-10-21 14:14:13
【问题描述】:
我有一个关于扩展继承自 UserControl 的自定义控件的问题。
public partial class Item : UserControl
{
public Item ()
{
InitializeComponent();
}
}
我想做一个继承自 Item 的控件
像这样的sg
public partial class ItemExtended : Item
{
public ItemExtended():base()
{
InitializeComponent();
}
}
这当然完美,遗产也有效,但我的问题在于设计师
我只是无法在设计中打开此 ItemExtended ......
它说:找不到类型“项目”的构造函数。
你有解释吗?
这是最好的方法吗?
谢谢
我当然是在 .NET Winform 上使用 c# :)
【问题讨论】:
-
如果您说出您使用的语言/框架,您可能会收到更多回复
标签: c# .net winforms inheritance user-controls