【问题标题】:.Net equivalent for the TTimer Delphi componentTTimer Delphi 组件的 .Net 等效项
【发布时间】:2010-03-16 03:01:31
【问题描述】:

是否存在与TTimer delphi 组件等效的 .net 类?

TTimer 用于简化调用 Windows API 定时器函数 SetTimer 和 KillTimer,并简化 处理 WM_TIMER 消息。采用 每个定时器一个定时器组件 应用程序。

定时器的执行发生 通过其 OnTimer 事件。 TTimer 有 确定的区间属性 计时器的 OnTimer 事件多久发生一次 发生。间隔对应于 Windows API SetTimer 的参数 函数。

提前致谢。

【问题讨论】:

    标签: c# .net delphi


    【解决方案1】:

    几个!最接近 Delphi TTimer 的可能是 System.Windows.Forms.Timer,但也有 System.Timers.TimerSystem.Threading.Timer 用于非 WinForms 环境。

    【讨论】:

      【解决方案2】:

      这可能是您想要的: Timer Component (Windows Form)

      由于 .NET 中有不止一个 Timer,这里有一个地方可以比较它们并解释不同之处: Comparing the Timer Classes in the .NET Framework Class Library

      【讨论】:

        【解决方案3】:

        也许System.Diagnostics.Stopwatch 会做你想做的事?

        编辑:抱歉,我没有意识到秒表不提供事件。正如 itowlson 所说,使用 System.Windows.Form.Timer 或 System.Threading.Timer。

        【讨论】:

          猜你喜欢
          • 2011-06-19
          • 1970-01-01
          • 1970-01-01
          • 2016-03-01
          • 2010-10-04
          • 1970-01-01
          • 1970-01-01
          • 2011-02-20
          相关资源
          最近更新 更多