InitializeComponent() error
I'm writing a program in VB, and suddenly when i changed a bit something in the InitializeComponent() within the "Windows Form Designer Generated Code", the Form1.vb[design] is gone...it's disappear, and i can't find a way to view it back. even the Shift+F7 (View > Designer) doesn't work as well....
the changes i did is about the combobox.text = "ComboBox1", i chaged it to
combobox.text = System.date.now.day ----> because the combobox is about the date of today's date...
after that, when i view the Form1.vb[design], the error page revealed. and then everything was gone...
my program is almost done, anyone know how to fix it? thnx..
J MPosted Jul 7, 2007, 3:56 AM
AlanPosted Jul 3, 2007, 6:34 AM
BTW, it's not a good idea to edit the InitializeComponent() method manually. At best the designer is likely to overwrite any changes you've made and at worst something like this can happen!
Instead, either change the properties of the form/control in the Properties window or put your code into the form's constructor or Form_Load eventhandler.