在使用委托设置界面上ToolStripStatusLabel类型的控件时间是,发现不能使用自定义的委托方法,在往上查找了一下发现不能使用involve来线程调用。因此只能使用原生委托方法。

//代理
public delegate void SetDateTime();

//
Thread thread = new Thread(new ThreadStart(DateTimeInfo));
thread.IsBackground = true; thread.Start(); 线程调用的方法 /// <summary> /// 线程调用 /// </summary> private void DateTimeInfo() { while (true) { SetDateTime setDate = new SetDateTime( delegate { toolStripStatusLabel2.Text = DateTime.Now.ToString(); }); setDate(); Thread.Sleep(1000); } // ReSharper disable once FunctionNeverReturns }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
  • 2023-03-20
  • 2021-07-20
  • 2021-07-31
  • 2022-12-23
猜你喜欢
  • 2022-01-20
  • 2021-05-27
  • 2022-12-23
  • 2021-07-08
  • 2022-12-23
  • 2021-10-28
相关资源
相似解决方案