读书人

请问一个关于Form继承的有关问题

发布时间: 2013-01-02 13:08:45 作者: rapoo

请教一个关于Form继承的问题
用C#做一个outlook插件 新建一个Outlook Form Region 让其继承System.Windows.Forms.Form 时报错
Error1Partial declarations of 'OutlookAddInTest.LabelForm' must not specify different base classes

哪位可以帮助下

代码如下


namespace OutlookAddInTest
{
public partial class LabelForm : Form
{

private RibbonTest ribbon = null;


public LabelForm() {

InitializeComponent();

}
public LabelForm(RibbonTest ribbon)
{
InitializeComponent();
this.ribbon = ribbon;
}

protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
}
// Occurs before the form region is displayed.
// Use this.OutlookItem to get a reference to the current Outlook item.
// Use this.OutlookFormRegion to get a reference to the form region.
private void LabelForm_FormRegionShowing(object sender, System.EventArgs e)
{
}

// Occurs when the form region is closed.
// Use this.OutlookItem to get a reference to the current Outlook item.
// Use this.OutlookFormRegion to get a reference to the form region.
private void LabelForm_FormRegionClosed(object sender, System.EventArgs e)
{
}

}
}

[解决办法]
看错误的意思,LabelForm已经在别处指定了base class而且不是Form,所以报错的

读书人网 >.NET Framework

热点推荐