Design view does not open in Visual Studio 2015

I am creating a win-forms application in C #. A few days ago, I opened my project, and the design was closed. I tried to right-click the form and click "open with ...", but there is no way to open it in view mode. All other questions related to this are for ASP pages, and the answers do not work (for example, Blend in Visual Studio 2015 - without design) . Below is a screenshot of my IDE: Screenshot of Visual Studio 2015

+4
source share
2 answers

Thanks to Mohit’s comment, I found that the root of the problem was that the class was at the top of the Form1.cs file. It should not have been the first class in the file. I moved the class under the main class and looked at the design again.

+8
source

You can press Shift+ F7(or only F7depending on the type of project) to open it.

In view mode, you can return to the code behind by pressing F7.

Edit

Take a close look designer.csand try to find any event that you created that is present in designer.cs, not in the code. If so, just remove this line from desginer.cswhich declares the event.

+4
source

Source: https://habr.com/ru/post/1621214/


All Articles