Form_Load event.

F

Frank Rizzo

In vb6, you could do all the resizing of the form (and its constituent
controls) in the form_load event, knowing that the form won't show up
until the Form_load event was exited.

In my vb.net app, I resize a bunch of controls, etc... in the Form_Load
event, but it seems that when the form actually appears on the screen,
there is still resizing going on.

How can I make sure that the form shows up after all the resizing has
been finished.

Thanks.
 
C

Cor Ligthert

Frank,

There is a difference between the showing of a MDI form and the showing of a
normal form, what are you using.

The normal form shows in normal code up after the completion of the Load
event. (It shows up in that event earlier when you place in that by instance
"me.show")

I hope this helps?

Cor
 
K

Ken Tucker [MVP]

Hi,

Form load event fires when the form is loading the activate event
fires after is loaded.

Ken
---------
In vb6, you could do all the resizing of the form (and its constituent
controls) in the form_load event, knowing that the form won't show up
until the Form_load event was exited.

In my vb.net app, I resize a bunch of controls, etc... in the Form_Load
event, but it seems that when the form actually appears on the screen,
there is still resizing going on.

How can I make sure that the form shows up after all the resizing has
been finished.

Thanks.
 
H

Herfried K. Wagner [MVP]

* Frank Rizzo said:
In vb6, you could do all the resizing of the form (and its constituent
controls) in the form_load event, knowing that the form won't show up
until the Form_load event was exited.

In my vb.net app, I resize a bunch of controls, etc... in the
Form_Load event, but it seems that when the form actually appears on
the screen, there is still resizing going on.

The form is shown after the last line of your 'Load' event handler is
executed. So you should no see any resizing going on. It's a known
problem that forms may flicker when being shown for the first time. To
speed up your resizing implementation, take a look at the form's
'SuspendLayout' and 'ResumeLayout' methods.
 

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