Progress on Windows Form

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Folke

    Progress on Windows Form

    I'm doing a lengthy operation and would like to
    update a textbox while working, but the tb gets updated
    AFTER the operation is finished!
    code:
    foreach (PDEHeaderItem pi in _pdeHandler._pa )
    {
    txtInfile.Text += "X";
    txtInfile.Inval idate();
    txtInfile.Updat e();
    ...

  • Adam Clauss

    #2
    Re: Progress on Windows Form

    "Folke" <anonymous@disc ussions.microso ft.com> wrote in message news:4c4201c480 80$4a1536d0$a30 1280a@phx.gbl.. .[color=blue]
    > I'm doing a lengthy operation and would like to
    > update a textbox while working, but the tb gets updated
    > AFTER the operation is finished!
    > code:
    > foreach (PDEHeaderItem pi in _pdeHandler._pa )
    > {
    > txtInfile.Text += "X";
    > txtInfile.Inval idate();
    > txtInfile.Updat e();[/color]

    Your textbox should update when you call Update()... though you might have to call Update on the form itself rather than the text
    box.

    Another alternative is to use a thread to do the work, and post status updates using BeginInvoke.

    --
    Adam Clauss
    cabadam@tamu.ed u


    Comment

    Working...