where to me.hide on the main form at start up

G

Guest

Hi,
My main form, that has lots of controls on it, and when my application
starts up I can see them all being drawn, which looks bad.

So I put a splash form in my project, and want to hide the main form until
its down all its work, and the .show it.

I put a me.hide in the form_load event to be the first command, but it seems
that the form is shown before the load event is fired as the form quick
flashes and then hides.

I put a me.hide into the main form new event before the initalisecomponents
command, but it seems to do nothing.

Where(or how) is the best way to hide the main from, so that it has drawn
all its controls etc, before showing it to the user

Thanks
 
A

Armin Zingler

NoSpammer said:
Hi,
My main form, that has lots of controls on it, and when my application
starts up I can see them all being drawn, which looks bad.

So I put a splash form in my project, and want to hide the main form until
its down all its work, and the .show it.

I put a me.hide in the form_load event to be the first command, but it seems
that the form is shown before the load event is fired

No, the Load event fires _because_ the Form has already been instructed
to be shown. Hiding the Form as the conseqeuence for showing it does not
make sense. If you still do it, the first instruction (Show) still comes
first, afterwards it's hidden.

as the form quick
flashes and then hides.

I put a me.hide into the main form new event before the initalisecomponents
command, but it seems to do nothing.

New is the constructor, not an event.
Where(or how) is the best way to hide the main from, so that it has drawn
all its controls etc, before showing it to the user

Drawing before showing is a contradiction. There is nothing to draw if
it's still invisible. Sometime it is the first time it has to be drawn.

I'm wondering _why_ drawing takes so long. Is there something special
about the Form? How many/what kind of controls? Any owner drawn controls?
 
A

AMercer

I'm surprised that doing a hide at the top of the load event and a show at
the bottom is not working for you. I routinely prevent sloppy initial draws
in the load event usually with Visible=false at the top and Visible=true at
the bottom. That should be the same as hide and show.
 
S

Scott M.

The best way to avoid this altogether is to have your appliation initially
start with a Sub Main() and from that sub, create an instance of the form
and then show that instance.

-Scott
 
J

Joe Cool

Hi,
My main form, that has lots of controls on it, and when my application
starts up I can see them all being drawn, which looks bad.

So I put a splash form in my project, and want to hide the main form until
its down all its work, and the .show it.

I put a me.hide in the form_load event to be the first command, but it seems
that the form is shown before the load event is fired as the form quick
flashes and then hides.

I put a me.hide into the main form new event before the initalisecomponents
command, but it seems to do nothing.

Where(or how) is the best way to hide the main from, so that it has drawn
all its controls etc, before showing it to the user

I have an application that acts similarly because it loads a complex
usercontrol. I set the Opacity property in design mode to 0, and then
set it to 100 after the usercontrol has loaded.
 

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