progressBar [modified]
-
I used a progressbar in my form and want to show it's value on a lable by this code :
for(i=0;i<100;i++)
{
for(j=0;j<100;j++)
{
// DO ...
}
progressbar.value = i;
lable.Text = i.tostring()+"%";
}but lable's text doesn't change in progress and just in the end of loop(i) shows the 100%. any suggestion? thanks. erfan -- modified at 7:42 Tuesday 18th July, 2006
-
I used a progressbar in my form and want to show it's value on a lable by this code :
for(i=0;i<100;i++)
{
for(j=0;j<100;j++)
{
// DO ...
}
progressbar.value = i;
lable.Text = i.tostring()+"%";
}but lable's text doesn't change in progress and just in the end of loop(i) shows the 100%. any suggestion? thanks. erfan -- modified at 7:42 Tuesday 18th July, 2006
Try to run your procedure in other thread. This article will help you to do it. My english is not so good. Please, correct my errors. Best regards, Alexey.
-
Try to run your procedure in other thread. This article will help you to do it. My english is not so good. Please, correct my errors. Best regards, Alexey.
-
I used a progressbar in my form and want to show it's value on a lable by this code :
for(i=0;i<100;i++)
{
for(j=0;j<100;j++)
{
// DO ...
}
progressbar.value = i;
lable.Text = i.tostring()+"%";
}but lable's text doesn't change in progress and just in the end of loop(i) shows the 100%. any suggestion? thanks. erfan -- modified at 7:42 Tuesday 18th July, 2006
-
This is due to UI doesn't get time redraw its area do this
lable.Text = i.tostring()+"%"; this.Refresh();