Form controls disappeared

Something odd has happened to my form....

I just spent the best part of an hour yesterday designing and perfecting a form "MainForm.vb" for my application. I saved it before closing the application. Today, I opened up Visual Basic 2005 Express Edition and all the controls have disappeared from the form. Furthermore, two files have appeared in the solution explorer, which have never shown there before, called "MainForm.Designer.vb" and "MainForm.resx" (not there for any of the other forms). The code in the first file still contains the instructions to add the missing controls to the form.

Can someone tell me how to link the control code back to the form so that I don't have to recreate it all over again. Also, I am curious to know why this would have happened in the first place.

Thanks.



Answer this question

Form controls disappeared

  • DarkShurik

    Thanks. What I did in the end was just create a new form MainForm2.vb, copy the code from  MainForm.Designer.vb to MainForm2.Designer.vb and then delete the original form and rename the new form to the original's name.

    I am sure your way would have worked too and been more sensible.

    I doubt I'll work out why it happened but at at least I won't need to panic next time.

    Mark


  • MotoMoto

    Heres something that may work I don't know

    Make copies of those three files some where else...

    Delete the current mainform in your solution explorer....

    Put those three files beck in the original directory and with the Solution Explorer

    Select Add Existing Item.....

    Select the MainForm.vb file.

    At least that's what I would try.



  • Form controls disappeared