Design view of one windows form lost all of the components that were on the screen.

After stopping a debug session at a data source error,

I clicked the tab to view the windows form design,

the form displayed as a big empty window with all the components missing.

I tried closing and reopening the project but the form still looked the same.

What happened to the components that were on my form


Regards,

Tom



Answer this question

Design view of one windows form lost all of the components that were on the screen.

  • Slow Learner

    I Hope you are using som custom controls. What happens is the InitializeComponent method gets altered in this scenario. Have a private method that has the whole code for creating custom controls and call that within the initialize component. In this way you wont loose the whole code instead only the method call will vanish. Still you will save your code.

    Ajeeth



  • Kevin Dente

    Hi Ajeeth,

    Thanks for answering my plea. Sorry but I am a beginner at using VB express. I had no custom controls. I had three DataGridView components and several more labels that were bound to my SQL server database but no custom controls.

    This was all working this morning. Then I tried to add a query to one of the data sources and got an error. I was debugging that error when my form (frmDisplayAccount) lost all its components. A few minutes after my first post, it got worse. Now I can't even get the empty form in the form designer.

    I had two forms: "frmFindAccount" and "frmDisplayAccount". The first one works same as always. The second one now has no form option to view it in the form designer, although the data frmDisplayAccount.vb still has all the original code.

    I think there is a bug in the VB Express IDE. Has anyone else had similar problems with the form designer disappearing

    Behind Schedule in Oregon,

    Tom


  • Design view of one windows form lost all of the components that were on the screen.