Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Building Controls (http://www.velocityreviews.com/forums/f59-asp-net-building-controls.html)
-   -   ActiveX .NET cannot update label's Text value? (http://www.velocityreviews.com/forums/t758504-activex-net-cannot-update-labels-text-value.html)

dvietha@gmail.com 08-04-2006 01:42 AM

ActiveX .NET cannot update label's Text value?
 
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


dvietha@gmail.com 08-04-2006 02:22 AM

Re: ActiveX .NET cannot update label's Text value?
 

dvietha@gmail.com 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();
}


dvietha@gmail.com 08-04-2006 05:50 AM

Re: ActiveX .NET cannot update label's Text value?
 

dvietha@gmail.com wrote:
> dvietha@gmail.com 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();
}



All times are GMT. The time now is 02:10 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.