private delegate void SetLabelTextCallBack(Label l, String text);
/// <summary>
/// 为 Label 控件设置 Text 文本
/// </summary>
/// <param name="l">Label</param>
/// <param name="text">Text</param>
private void SetLabelText(Label l, String text)
{
     if (l.InvokeRequired)
     {
         SetLabelTextCallBack call = new SetLabelTextCallBack(SetLabelText);
         this.Invoke(call, new object[] { l, text });
      }
      else
     {
         l.Text = text;
      }
 }

 

相关文章:

  • 2022-12-23
  • 2021-07-14
  • 2022-03-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2021-12-22
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-25
  • 2022-12-23
  • 2022-12-23
  • 2021-05-18
相关资源
相似解决方案