i am new to C# and I want to know why if i have a for loop inside a button handler and if i try to display the loop counter in a label , only the last value of the counter is displayed. Is there any work around this?
private void button1_Click(object sender, EventArgs e)
{
for (int i = 0; i < 100; i++)
{
this.label1.Text = Convert.ToString(i);
Thread.Sleep(1000);
}
}