abstract class 的Windoes Form窗体,不被IDE支持???
在写一个窗体的基类,实现一个 public abstract void DoSomething()的虚函数,(由于要求继承者必须重写这个虚函数,所以没有用virtual), 基类代码如下:
public abstract class frmFather : System.Windows.Forms.Form
{
private System.ComponentModel.Container components = null;
public frmFather()
{
InitializeComponent();
}
protected override void Dispose( bool disposing )
{
if( disposing )
if(components != null)
components.Dispose();
base.Dispose( disposing );
}
private void InitializeComponent()
{
this.SuspendLayout();
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(544, 293);
this.Name = "frmFather";
this.Text = "frmFather";
this.ResumeLayout(false);
}
public abstract void DoSomething();
}
这个基类可以正常被继承了,子窗体也实现了必须实现DoSomething方法了,但现在的问题是当设计上述窗体的继承窗体时,设计器就一片花白。。。说不支持abstract 类型的窗体,创建不了实例。。。请问各位高手有好的解决办法没有?