ActiveX .NET cannot update label's Text value?

Discussion in 'ASP .Net Building Controls' started by dvietha@gmail.com, Aug 4, 2006.

  1. Guest

    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
     
    , Aug 4, 2006
    #1
    1. Advertising

  2. Guest

    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();
    }
     
    , Aug 4, 2006
    #2
    1. Advertising

  3. Guest

    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();
    }
     
    , Aug 4, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    900
  2. =?Utf-8?B?ZGF2aWQ=?=

    JavaScript assigns a value to label control text value?

    =?Utf-8?B?ZGF2aWQ=?=, May 24, 2006, in forum: ASP .Net
    Replies:
    8
    Views:
    23,941
    =?Utf-8?B?ZGF2aWQ=?=
    May 26, 2006
  3. CSharpner
    Replies:
    0
    Views:
    1,093
    CSharpner
    Apr 9, 2007
  4. vml
    Replies:
    0
    Views:
    1,062
  5. Knut Krueger
    Replies:
    8
    Views:
    297
    Knut Krueger
    Aug 20, 2013
Loading...

Share This Page