【发布时间】:2011-10-28 07:44:08
【问题描述】:
我想从 Forms.Timer 控件继承,因为我想向它添加一个方法,但是它需要在实例化时传递一个 System.ComponentModel.Container 给它,这需要传递给基类.
我有以下无法编译的内容:
class Timer : System.Windows.Forms.Timer
{
public Timer() : base (System.ComponentModel.Container)
{
}
public static bool IsTimeToActivate()
{
return false;
}
}
容器参数被标记为:
此时类名无效
我在这里缺少一些基本的理解吗?
【问题讨论】:
标签: c# .net winforms windows-services