How do I open a Visual Studio project in design view?
Asked Answered
F

9

45

I saved my project, but now I can't open it up in design view where you see all the buttons and stuff. Visual Studio 2012 Anyone know how?

Fluting answered 16/6, 2013 at 20:48 Comment(1)
Projects are not opened in design view. forms and such may be opened in design view.Scupper
S
69

You can double click directly on the .cs file representing your form in the Solution Explorer :

Solution explorer with Design View circled

This will open Form1.cs [Design], which contains the drag&drop controls.

If you are directly in the code behind (The file named Form1.cs, without "[Design]"), you can press Shift + F7 (or only F7 depending on the project type) instead to open it.

From the design view, you can switch back to the Code Behind by pressing F7.

Striper answered 16/6, 2013 at 21:1 Comment(5)
neither shift +f7 or f7 does anything... when i search test in the solution explorer it says "no results found". I have a few files here, should i be looking at the extension .design.vb, .vb, or .resx?Fluting
i clicked "save all" earlier. I just went through everything in that folder and eventually found something that linked back to the design tab. Thanks!Fluting
I have project in C++ and there is missing file with .cs extension. What can be a problem? I have only standard .cpp and .h files. I can't open MyForm.h in designer.Biysk
there is no .cs file at all, just *.Designer.vbDeclassify
I just get the properties page popupInstauration
T
13

My problem, it showed an error called "The class Form1 can be designed, but is not the first class in the file. Visual Studio requires that designers use the first class in the file. Move the class code so that it is the first class in the file and try loading the designer again. ". So I moved the Form class to the first one and it worked. :)

Trench answered 7/8, 2016 at 23:3 Comment(2)
In my case there were two classes declared before the form class, and it was preventing the design view from being displayed.Quiteria
This is working solution! Using visual studio 2015. Thank you!Schmid
X
4

From the Solution Explorer window select your form, right-click, click on View Designer. Voila! The form should display.

Xylograph answered 28/10, 2014 at 13:39 Comment(0)
L
2

Click on the form in the Solution Explorer

Liscomb answered 16/6, 2013 at 20:51 Comment(1)
Double click (not single click) will open the designerNightly
C
2

Just Shift+f7 and Design view will open OR Right-click on your form file and Click on View Designer

Cairistiona answered 1/3, 2021 at 12:43 Comment(1)
There is no View Dwesigner on right click :(Declassify
H
1

@Pierre's answer is not always applicable. When I messed up the files in the solution folder a bit (maybe add some code from outside which conflicts the GUI, I don't know precisely), then the Design View does not show up. In fact, my "Solution Explorer" is actually "Solution Explorer - Folder View". There is no object hierachy shown in the Solution Explorer, but just a file & folder view.

Hubby answered 2/8, 2022 at 11:47 Comment(0)
M
1

I had this problem in Visual Studio 2019 today. When I right-clicked a form or user control in Solution Explorer, there was no "View Designer Shift-F7" option. The "View Code F7" option was there, but not the Shift-F7 option. I noticed that I could view and work on the design view for two forms, that I opened before the problem surfaced. But Visual Studio would not let me open more design views.

My solution is: In another project, in the same solution, I created a new Windows Form. Now the "View Designer Shift-F7" is visible and working for all forms and user controls, in all projects in my solution. I deleted the latest new form, and Design View still works. This solved the problem for me.

Mileage answered 11/12, 2022 at 10:38 Comment(0)
S
0

If non of the above worked do this Tools-> Option-> XAML Designer -> Enable XAML designer Then you need to restart Visual sudio.

Scalawag answered 29/6, 2023 at 2:31 Comment(0)
H
0

For me, the issue was that I had added a class before the partial form class in code behind, but removing it was not enough to get the designer option back in the solution explorer.

I also had to edit the project file to add <SubType>Form</SubType> under the compile include for the file.

<Compile Include="Form1.cs">
  <SubType>Form</SubType>
</Compile>
Hypocoristic answered 10/7 at 12:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.