日期:2014-05-18 浏览次数:20716 次
private void button1_Click(object sender, EventArgs e) { Thread thread = new Thread(new ThreadStart(ThreadTest)); thread.Start(); } private void ThreadTest() { UpdateTimeHandler ut = new UpdateTimeHandler(UpdateTime); this.Invoke(ut, DateTime.Now); } private void UpdateTime(DateTime dt) { this.label1.Text = dt.ToString(); } private delegate void UpdateTimeHandler(DateTime dt);