0

I accidentally closed my form designer window (the place where we put buttons and all). Now, when I reopened the project, it's not coming up. Nothing is present in solution explorer also. I explored the complete project folder, but couldn't find anything. Please help.

Snapshot

solution explorer pic

  • You've obviously still got the designer code file so you appear to be wrong when you said that you couldn't find anything in the Solution Explorer or the project folder. I guess the question is whether you still have the user code file. I also have to wonder whether the fact that the file and the class have different names is an indication that you mucked something up by changing the type name in one code file but not the other. In future change the file name in the Solution Explorer and that will prompt to change the type name automatically. Is there a Form2.vb file? What class name is in it? – jmcilhinney Jul 25 '20 at 14:52
  • Yes, Form2.vb file is there in the folder. By "couldn't find anything in the Solution Explorer" I meant, I couldn't find anything that can help me bring back the designer window. Can you just guide me, if designer window is closed once, how to bring it back? Sorry, if I caused confusion earlier. – Pulkit Bagri Jul 25 '20 at 14:57
  • Were you planning on answering my second question? – jmcilhinney Jul 25 '20 at 14:59
  • Clearly you've been editing the Designer.vb file by hand. Very bad idea, changes in this file must only be made by the designer. Manual changes can easily push it into a state where the designer no longer understands what it contains. No more designer view. Restore from source control to recover. – Hans Passant Jul 25 '20 at 23:01
  • Could you provide some related code in your 'Form2.Designer'? It will help others anayze your problem. – Xingyu Zhao Jul 28 '20 at 07:17

1 Answers1

0

In "solution explorer", find your Form2.Designer.vb. Then, right click -> View Designer (or something like that: I don't use the english version of Visual Studio). See the following screenshot:

Screenshot

I have Visual Studio in Italian, but the icons are the same and it's quite intuitive...

PS: If this doesn't work, there is probably an error in the code, which we cannot analyze without seeing it.

Calaf
  • 1,133
  • 2
  • 9
  • 22
  • I have updated solution explorer snapshot in the question. I do not see icons like yours. – Pulkit Bagri Jul 25 '20 at 17:36
  • Try to right click on Form2.vb (parent of Form2.Designer.vb) and click on _View Designer_ – Calaf Jul 25 '20 at 17:38
  • I have updated snapshot after right clicking. I do not see the option as highlighted in your snapshot. – Pulkit Bagri Jul 25 '20 at 17:45
  • Mmmm... Probably there is some mistakes in the code behind. Try to undo your last modification in the code (ex, if you've added an inner class, try to remove it). As another option, create a new project and try to copy the code a little at a time to understand what causes this "error". – Calaf Jul 25 '20 at 17:55
  • To understand if the design view works (and I think so), just right click on the project name in solution explorer and add a new Windows form. The view will automatically open. – Calaf Jul 25 '20 at 17:58