Waiting Dialog Problem - Will Not Show fully before continuing

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • goetzUM
    New Member
    • Jan 2010
    • 1

    Waiting Dialog Problem - Will Not Show fully before continuing

    I am creating a Waiting Dialog in C# that looks like this:

    Code:
    WaitingDialog wait = new WaitingDialog();
    wait.Show();
    //do heavy computation here
    wait.Close();
    My waiting dialog never fully shows. The dialog appears but the message in the window doesn't fully paint because the computation is taking up all the resources and never allows the window to show fully.

    How do I get around this problem?
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    Add a line between 2 and 3

    Application.DoE vents();

    Comment

    • Plater
      Recognized Expert Expert
      • Apr 2007
      • 7872

      #3
      Also, if your heavy computations are loop-based, try sticking the doevents line in the loop too, helps keep the gui window active

      Comment

      Working...