Is it a constructor or a function called InitializeComponent? Also would you please explain why? Thank you very much!
Printable View
Is it a constructor or a function called InitializeComponent? Also would you please explain why? Thank you very much!
You put initialisation code for non-UI classes in the constructor.
You shouldn't be editing the InitializeComponent part of any control as this is VC++ generated : you'll more likely than not either muck up the designer view or lose your code the next time you edit the control.
If you're talking about a form you have the Load event, which I'd recommend. You can override the OnLoad virtual protected method in your derived form class and do your initialisation in there.
Darwen.