Why does Form load time increase?

  • Thread starter Thread starter Floris Briolas
  • Start date Start date
F

Floris Briolas

Dear you,..

I have a performance issue, I've created a simple class and dropped 4
buttons on it.. (no events yet)

I’m measuring the time that is needed for calling the constructor...

void on_click(sender... events...)
{
int start = Environment.TickCount;
Form2 frm2 = new Form2();
int stop = Environment.TickCount;
.. code to report time it took ...
}

When I call the on_click function i see an increase with every iteration
in time it takes to load a form.. How can this be? I was expecting a
minor fluctuation but,.. it goes up to 3 seconds and will increase with
every iteration.
 
Don't forget to call Form.Dispose every time your form is closed

or don't create a new form everytime if you just like to display THE SAME
form again...

Boris
 
Back
Top