Best way to open windows forms

  • Thread starter Thread starter Steve Lloyd
  • Start date Start date
S

Steve Lloyd

Hi,

I have a multi form windows application but when i open new forms they do
not load up "crisply", they open bit by bit as the items are drawn.

What is the best way to open the form so that the entire form is drawn/shown
at the same time.

I hope this post makes sense, it is a bit hazey I'm affraid.

Thanks for any help

Steve.
 
* "Steve Lloyd said:
I have a multi form windows application but when i open new forms they do
not load up "crisply", they open bit by bit as the items are drawn.

What is the best way to open the form so that the entire form is drawn/shown
at the same time.

\\\
Dim f As New FooForm()
f.Show()
///

How many controls are you using on your form?
 
There are about 20-30.

I've tried minimizing the form until the initialization is complete and then
maximize it. But this too draws slowly.

Is this just how it is is there some fancy to buffer the display until it is
all complete ?

Thanks

Steve.
 
* "Steve Lloyd said:
I've tried minimizing the form until the initialization is complete and then
maximize it. But this too draws slowly.

Is this just how it is is there some fancy to buffer the display until it is
all complete ?

I doubt that there is a way to do that. The "problem" is strongly
related to .NET's and Windows Form's memory management. Whenever a form
is minimized, it is written to disk, and opening it will require some
time.
 
I had a similar problem which I solved. My problem was
caused by having code in the form's Load event that did
some database initialization work that took about 0.5
seconds. The form would sort of half draw and then the
rest would pop up after a short delay.

I solved it by putting my initialization code in a routine
called from the constructor of the form. If you expand
the section of the code that says something like "windows
designer generated code", near the top you will see a
comment that says "put your initialization code here". I
put a call to a routine of mine that does my
initialization and left nothing in the forms Load event.
That solved the problem.

Hope this works for you.

Tom
 
Back
Top