472,119 Members | 1,690 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,119 software developers and data experts.

form onload question

Cc
does event onload mean form already loaded or before loaded?
I make a form and I inherit that form on another form, when I run, it
execute the process on the parent form without showing the form on screen
until it done. so does this mean onload mean before form load?

if I want after form load what should I do?
Nov 20 '05 #1
3 11449
Hello,

"Cc" <ko*****@singnet.com.sg> schrieb:
does event onload mean form already loaded or before
loaded? I make a form and I inherit that form on another
form, when I run, it execute the process on the parent
form without showing the form on screen until it done.
so does this mean onload mean before form load?


'OnLoad' is executed before the handler for the 'Load' event, it raises the
'Load' event. The 'Load' event is raised before the form is being shown for
the first time.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #2
Hi Cc,

Form_Load occurs before Form.Show, ie. the Form doesn't Paint until
Form_Load is finished. You can, of course, call Form.Show within Form_Load.

A good way to find out what is happening in these sort of situations
(works with mouse down, click/dblclick, up, etc, too) is to have a global
string to which you append a message in each of the event handlers.

Public S As String

In the Form's New()
S = S & "New" & vbCrLf

In Form_Load()
S = S & "Load" & vbCrLf

In Form_Paint()
S = S & "Paint" & vbCrLf

In Button1_Click
MsgBox (S)

What is it that you want to do after Form_Load?

You could put this in Form_Load and see if that helps.
Me.Show
Application.DoEvents

Regards,
Fergus
Nov 20 '05 #3
"Cc" <ko*****@singnet.com.sg> schrieb
does event onload mean form already loaded or before loaded?
OnLoad is an overridable procedure, Load is an event.
I make a form and I inherit that form on another form, when I run,
it execute the process on the parent form without showing the form on
screen until it done. so does this mean onload mean before form
load?

if I want after form load what should I do?


OnLoad is called before the Form is shown the first time. OnLoad raises the
Load event.

The first event after the Form is shown, is the Activated event. Activated
can also occur several times afterwards.

One solution:

Dim f as new form1
f.show
f.refresh
f.StartProcess
--
Armin

Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Halldór Ísak Gylfason | last post: by
2 posts views Thread by brian | last post: by
5 posts views Thread by Sergey Atun | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.