I want to inherit from a Forms.Timer control as I’d like to add a method to it, however it needs to be passed a System.ComponentModel.Container to it on instantiation, which would need passed to the base class.
I have got the following which won’t compile:
class Timer : System.Windows.Forms.Timer
{
public Timer() : base (System.ComponentModel.Container)
{
}
public static bool IsTimeToActivate()
{
return false;
}
}
With the Container argument being flagged as:
Class name not valid at this point
Am I missing some fundamental understanding here?
If all you want to do is add a method to the timer, I think an extension method is a better solution: