On Fri, 25 May 2007 02:04:08 -0700, Miroslav Stampar
<mi**************@gmail.comwrote:
Form1() is constructor and Form1_Load() is an event called during the
load of Form1. Form1() is called first and shortly after that
Form1_Load() is called. Calls are made automatically. Proper way for
putting initialization statements would be to put them into
Form1_Load() [...]
Just to clarify, it depends on what sort of "initialization" statements
you're talking about.
As I understand it, the constructor is executed before the all of the
underlying Windows data has been initialized. The internal .NET stuff is
all there, but it's not all hooked up to Windows yet. So, you should wait
until the Load event to do anything that involves actually interacting
with Windows.
But for any sort of internal data initialization, the constructor is a
perfectly appropriate to do that. In fact, I'd argue that it's a more
appropriate place to do that, because the constructor is all about
*creating* the object, while the Load event is specifically for dealing
with things that have to be done as the control (a Form in this case) is
actually being displayed.
Pete