在两个名字控件下都有Timer,把名字控件加上就行了。

解决方案 »

  1.   

    你在帮助里查一下Timer的类名,加上试试。
      

  2.   

    我呢建议你多看看msdn你觉得怎么样?能给我分吗?
      

  3.   

    在.net中有3中timer 不知道你用的是那种啊??使用 TimerCallback 委托指定由 Timer 调用的方法。此方法不在创建计时器的线程中执行,而是在系统提供的一个单独线程池线程中执行。在启动时间结束之后,TimerCallback 委托将调用一次该方法,并继续在每个计时器间隔调用一次该方法直到调用 Dispose 方法(或者以间隔值 Infinite 调用 Timer.Change 方法)为止。计时器委托在构造计时器时指定,并且不能更改。Timer 的启动时间在 Timer 构造函数的 dueTime 参数中传递,时间周期在 period 参数中传递
    你用的是那个命名空间啊!
    System.Threading.Timer 这个试试
      

  4.   

    整个例子给你看看,应该可以解决你的问题using System;
    using System.Threading;namespace TestThreadPool
    {
    class TimerExampleState
    {
    public int counter;
    public Timer tmr;
    }
    class App
    {
    private static int _counter=0;
    private static Timer _tmr; public static void Main()
    {
    //TimerExampleState s=new TimerExampleState(); // Create the delegate that invokes methods for the timer.
    TimerCallback timerDelegate=new TimerCallback(CheckStatus);

    // Create a timer that waits one second, then invokes every second.
    _tmr=new Timer(timerDelegate,null,1000,1000); // Keep a handle to the timer, so it can be disposed.
    //s.tmr=timer;
    while(_tmr!=null)
    Thread.Sleep(0);
    Console.WriteLine("Timer example done.");
    Console.ReadLine();
    }
    static void CheckStatus(object state)
    {
    //TimerExampleState s=(TimerExampleState)state;
    _counter++;
    Console.WriteLine("{0} Checking Status {1}",DateTime.Now.TimeOfDay,_counter);
    if(_counter==5)
    {
    _tmr.Change(10000,100);
    Console.WriteLine("Changed...");
    }
    if(_counter==10)
    {
    Console.WriteLine("Disposed");
    _tmr.Dispose();
    _tmr=null;
    }
    }
    }
    }