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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top