wrote:
> wrote:
> > Hi All,
> >
> > I write an ActiveX containing a progress bar and a label by C#. When
> > running in IE, the progress bar is OK; but I cannot update the value of
> > label's Text.
> >
> > Plz explain this problem for me
> >
> > thanks,
> > HaDV
>
> Following is my code:
> for (int i=1; i <= totalFile; i++)
> {
> Thread.Sleep(this.SleepTime);
> completedFile += 1;
> lblProgress.Text = String.Format("{0} / {1}", completedFile,
> totalFile);
> progressBar.PerformStep();
> }
I got it.
Adding lblProgress.Update() after lblProgress.Text = ... like below:
for (int i=1; i <= totalFile; i++)
{
Thread.Sleep(this.SleepTime);
completedFile += 1;
lblProgress.Text = String.Format("{0} / {1}", completedFile,
totalFile);
lblProgress.Update();
progressBar.PerformStep();
}