[C#] 纯文本查看 复制代码 public MainForm()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
ThreadPool.UnsafeQueueUserWorkItem((param) => {
var isCreated = false;
while (!isCreated)
{
if (this.IsHandleCreated) {
isCreated = true;
label1.BeginInvoke(new Action(() => label1.Text = "1"));
Thread.Sleep(1000);
label2.BeginInvoke(new Action(() => label2.Text = "2"));
Thread.Sleep(1000);
label3.BeginInvoke(new Action(() => label3.Text = "3"));
Thread.Sleep(1000);
label4.BeginInvoke(new Action(() => label4.Text = "4"));
}
}
}, null);
//
// TODO: Add constructor code after the InitializeComponent() call.
//
}
这样就可以了!!!! |