private delegate void UpdateDelegate();
UpdateDelegate theDelegate = delegate()
{
//update the message shown in the UI
lblMessage.Text = e.Message;
};
this.Invoke(theDelegate);
本文介绍了一个使用C#实现的委托模式实例,展示了如何定义私有委托类型并利用该委托更新UI中的消息显示。通过Invoke方法确保UI更新在主线程中进行。
3056

被折叠的 条评论
为什么被折叠?



