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. Advertisements

  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. Advertisements

  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. Advertisements

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:
    1
    Views:
    10,349
    Brock Allen
    May 24, 2005
  2. Replies:
    0
    Views:
    1,179
  3. =?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:
    24,216
    =?Utf-8?B?ZGF2aWQ=?=
    May 26, 2006
  4. codecraig
    Replies:
    4
    Views:
    534
    Kent Johnson
    Apr 19, 2005
  5. CSharpner
    Replies:
    0
    Views:
    1,423
    CSharpner
    Apr 9, 2007
  6. Cirene
    Replies:
    7
    Views:
    7,840
    Cirene
    Jun 18, 2008
  7. narke
    Replies:
    1
    Views:
    858
  8. Knut Krueger
    Replies:
    8
    Views:
    647
    Knut Krueger
    Aug 20, 2013
Loading...