bad to skip InitializeComponent();

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there any side effects to skipping InitializeComponent() and
calling a custom method instead?

I actually layed out the form, copied the InitializeComponent() method
and put it in layout1() and then repeated that process to create layout2()...
I'm calling these instead, any internal problems arise from this?
 
You lose some dwesigner integration but that about it

regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

Is there any side effects to skipping InitializeComponent() and
calling a custom method instead?

I actually layed out the form, copied the InitializeComponent() method
and put it in layout1() and then repeated that process to create layout2()...
I'm calling these instead, any internal problems arise from this?
 
Craig,
I HAD to do the identical thing because I had so many objects setup in the
designer (this InitializeComponent()) that my app failed in "release" mode.
I left some of the code in InitializeComponent and pulled all the massive
item load code into my own method which I called right after
InitilizeComponent(). The results were that now my app will execute.
Apparently only so many objects can be maintained in InitializeComponent.
I did notice that when I pulled out all the item collections out of
InitializeComponent() that they were then gone from the Designer when I went
back into it.
So, you will lose the ability to use the designer but the app does execute!
Carl Perkins
 
Back
Top