private void button4_Click(object sender, EventArgs e)
{
Task.Factory.StartNew(StartUIForm, token, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext());
}
private void StartUIForm()
{
int i = 0;
while (!tokenSource.IsCancellationRequested)
{
i++;
this.textBox1.Text = i.ToString();
Thread.Sleep(1000);
}
}
这种死循环,更新UI卡死怎么解决,新手求助