winform 跨线程设置控件属性
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; } }