【问题标题】:ToolStripStatusLabel delay messageToolStripStatusLabel 延迟消息
【发布时间】:2013-05-16 09:25:44
【问题描述】:

我有一个简短的问题。

在我的程序中,我想使用 ToolStripStateLabel 向用户显示一些信息。来自 c++ 和 QT 我不太了解这个控件的 .net 变体。因为我想在一定时间内向用户显示一条消息,即 3000 毫秒。或 3 秒,但我似乎无法弄清楚如何做到这一点。那么,它甚至可能吗?我该怎么做?

【问题讨论】:

    标签: c# time statusbar toolstripstatuslabel


    【解决方案1】:

    不幸的是,您必须实现 Timer 才能做到这一点。

    private void InitTimer()
    {
      var myTimer = new Timer();
      myTimer.Tick += new EventHandler(TimerEventProcessor);
    
      // Sets the timer interval to 3 seconds.
      myTimer.Interval = 3000;
      myTimer.Start();
    }
    
    private static void TimerEventProcessor(object sender, EventArgs e)
    {
      ToolStripStatusLabel.Visible = false;
      (sender as Timer).Stop();
    }
    

    【讨论】:

      猜你喜欢
      • 2018-10-11
      • 1970-01-01
      • 2017-06-10
      • 1970-01-01
      • 1970-01-01
      • 2012-01-28
      • 2011-05-25
      • 2019-07-26
      • 2019-08-01
      相关资源
      最近更新 更多