Progress Bar

Howdy,

I have a form that currently does a lot of processing when a button is clicked.  I want to show the user a progress bar while the processing is being done.  I want to open a new form with this progress bar that will update the progress bar as it processes and then close the window when it's done.  Unfortunately I can't figure out how to do this, as if I place the processing code in the Form_Load event it does it all before the form even opens.

Any ideas

Little'Un.


Answer this question

Progress Bar

  • ianhannaford

    you could open up your progress form in the mainForm_Load event and do your processing in the progressForm_Load event. ah like so...

    MainForm_Load(object sender, EventArgs e)
    {
         ProgressForm frm = new ProgressForm();
         frm.Load += new EventHandler(progressForm_Load);
    }

    progressForm_Load(Object sender, EventArgs e)
    {
         //do some processing
         //PerformStep on progress bar on child form...
         //blah blah blah
    }

  • Progress Bar