using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Threading;
namespace WindowsApplication2
...{
public partial class Form1 : Form
...{
System.Threading.Timer timer;
private delegate void setInfo(string msg);
private void setMsg(string msg)
...{
this.Invoke(new setInfo(setmsg), new object[] ...{ msg });
}
private void setmsg(string msg)
...{
txtMsgInfo.AppendText(msg);
}
private void TimerTick(object state)
...{
setMsg("a");
}

public Form1()
...{
InitializeComponent();
TimerCallback OnTimerTick = new TimerCallback(TimerTick);
timer = new System.Threading.Timer(OnTimerTick, null, 2000, 2000);
}
}
}发表于 @ 2008年01月26日 15:04:00 | 评论( loading... ) | 举报| 收藏