E
Emanuele Ornella
Hello everybody,
I'm just trying to do a simple task: display a count number that
increases in the time in a label on a Form.
So I uses the label1.Refresh( ) method to force the drawinig:
private void counting()
{
for (int i = 0; i < 100;i++ )
{
System.Threading.Thread.Sleep(100);
label1.Text = "Counting ... " + i;
label1.Refresh();
}
MessageBox.Show("END");
}
That works fine if I do not move the Form. If I try to move or resize
the form I have the label "frozen" on the number displayed when the
movement started.
So I tryed to refresh the Form too inside the loop:
private void counting()
{
for (int i = 0; i < 100;i++ )
{
System.Threading.Thread.Sleep(100);
label1.Text = "Counting ... " + i;
label1.Refresh();
this.Refresh();
}
MessageBox.Show("END");
}
But I have the same result.
Any suggestion?
Thanks
ema
I'm just trying to do a simple task: display a count number that
increases in the time in a label on a Form.
So I uses the label1.Refresh( ) method to force the drawinig:
private void counting()
{
for (int i = 0; i < 100;i++ )
{
System.Threading.Thread.Sleep(100);
label1.Text = "Counting ... " + i;
label1.Refresh();
}
MessageBox.Show("END");
}
That works fine if I do not move the Form. If I try to move or resize
the form I have the label "frozen" on the number displayed when the
movement started.
So I tryed to refresh the Form too inside the loop:
private void counting()
{
for (int i = 0; i < 100;i++ )
{
System.Threading.Thread.Sleep(100);
label1.Text = "Counting ... " + i;
label1.Refresh();
this.Refresh();
}
MessageBox.Show("END");
}
But I have the same result.
Any suggestion?
Thanks
ema