Form loading speed optimising

J

John

Hi

I have a form which does a few operations at start-up which take a long
while. I would like to divide the operations in two parts, one that can run
first time form is loaded and second part that only runs once user opens the
form subsequent time. How do I go about doing this? I presume I can include
first part of operations in form load method, is there an unhide method to
run the second part of operations?

Thanks

Regards
 
L

Lloyd Sheen

John said:
Hi

I have a form which does a few operations at start-up which take a long
while. I would like to divide the operations in two parts, one that can
run first time form is loaded and second part that only runs once user
opens the form subsequent time. How do I go about doing this? I presume I
can include first part of operations in form load method, is there an
unhide method to run the second part of operations?

Thanks

Regards

What happens to the form between the first load and the subsequent load?

Is it just hidden or is it reloaded?

LS
 
J

John

The user can close form the cross button at the top or can press the button
labelled close which does Me.Close.

Thanks

Regards
 
L

Lloyd Sheen

John said:
The user can close form the cross button at the top or can press the
button labelled close which does Me.Close.

Thanks

Regards

Ok since you are closing the form do you keep info from the first open
somewhere? If so this would be the place to hold a boolean value which
could be checked on the opening of the form. A "firsttime" switch if you
want.

How do you control the opening of the form?
LS
 
G

Guest

Dim frm As New frmMyForm
frm.ShowDialog()

I believe dialogs are NOT destroyed after they are closed.

So what you can do is:


Private frm as new frmMyForm <-- Place in class


frm.ShowDialog() <-- call as normal.


You don't need to instantiate a new copy each time :)
 

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

Top