Link to home
Start Free TrialLog in
Avatar of rpkhare
rpkhareFlag for India

asked on

Form Initialize and Form Load

What is the difference between Form Initialize and Form Load? I am ofter confused on which functions to call in Form Initialize and which on Load.
Avatar of Wayne Taylor (webtubbs)
Wayne Taylor (webtubbs)
Flag of Australia image

There is no Form.Initialize() event in .Net 2005. For calling routines when the form first opens, use the Form.Load() event.

Wayne
Initialize is very early in the call chain. You normally cannot access controls from it.
Your form initialise would be one of the first things, so I tend to declare any simple stuff there which is required whilst the form is loading.  For the Form_Load I generally use that to set things such as whether a control is visible yet etc.
Avatar of rpkhare

ASKER

emoreau,

Previously I was filling my DataGridView on Form Load. Later I decided to fill in From Initialize followed by Application.DoEvents(). This has considerably increased the performance. Why?
SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rpkhare

ASKER

Can you please explain: Suspend Layout and Resume Layout.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial