private void button1_Click(object sender, EventArgs e)
{
Task t1 = Task.Factory.StartNew(() => k1());
Task t2 = Task.Factory.StartNew(() => k2());
} void k1()
{
for (int i = 0; i < 100; i++)
{
Thread.Sleep(100);
this.Invoke(new Action(
() => { this.label1.Text = i.ToString(); }));
}
} void k2()
{
for (int i = 0; i < 100; i++)
{
Thread.Sleep(100);
this.Invoke(new Action(
() => { this.label2.Text = i.ToString(); }));
}
}