public
partial
class
Form1 : Form
{
private delegate void FlushClient(); // 代理
public Form1()
{
InitializeComponent();
}
private void Form1_Load( object sender, EventArgs e)
{
FlushClient fc = new FlushClient(ThreadFunction);
fc.BeginInvoke( null , null );
}
private void ThreadFunction()
{
while ( true )
{
this .textBox1.Text = DateTime.Now.ToString();
Thread.Sleep( 1000 );
}
}
}
{
private delegate void FlushClient(); // 代理
public Form1()
{
InitializeComponent();
}
private void Form1_Load( object sender, EventArgs e)
{
FlushClient fc = new FlushClient(ThreadFunction);
fc.BeginInvoke( null , null );
}
private void ThreadFunction()
{
while ( true )
{
this .textBox1.Text = DateTime.Now.ToString();
Thread.Sleep( 1000 );
}
}
}