Create form, saved, open it again

JohnSe

Active member
Joined
Jun 17, 2019
Messages
27
Programming Experience
5-10
Hello,

When I created a form and saved it, how do I open it again in visual studio and show the form ? Please advice. Thanks
 
You open any project item by double-clicking it in the Solution Explorer.

No you can't. If you saved and close it and close your visual studio and reopen it you can't. It doesn't appear on your Solution Explorer.
I just tried it. I can open it but I can't run the code.
How do you open the form and still in the form format and can still run the code ?
 
What version of Visual Studio are you using?
Are you sure you didn't accidentally flip the option to always show the form code instead of the Windows Form designer?
To run the code, you would simply press F5 or Choose the Debug.Start Debugging menu item. Alternatively, you could press Ctrl-F5 or the Debug.Start without Debugging menu item.
 
Can you write down your exact repro steps?

For me, using either VS2015, VS2017, or VS2019, the following steps work fine for me to be able to re-open and run the form that I saved.
1. Start Visual Studio
2. Create a new Project.
3. Select a WinForms application.
4. Name the project and solution.

Results:
An empty form shows up in the Windows Forms Designer in Visual Studio.

5. Add a Button control to the empty Form in the Forms Designer that is shown by default, and provide some text for it.
6. File.Save All
7. Press F5 to run the code.

Results:
A window pops up just like the form I'd edited.

9. Exit out of the window (by pressing the X close button on the window chrome).
10. Exit out of Visual Studio.
11. Start Visual Studio.
12. Load the solution from step 4 above.

Results:
Visual Studio loads the solution and the form is once again visible in the Windows Forms Designer.

13. Press F5 to run the code.

Results:
A window pops up just like previously.

14. Exit out of the window (by pressing the X close button on the window chrome).
15. Close the Forms Designer tab.
16. Exit out of Visual Studio.
17. Start Visual Studio
18. Load the solution from step 4 above.

Results:
Visual Studio loads the solution, but this time no Forms Designer because we closed it on step 15.

19. Double click on Form1.cs in the Solution Explorer.

Results.
The form with the control shows up in the Windows Forms Designer in Visual Studio.

20. Press F5 to run the code.

Results:
A window pops up just like previously.
 
No you can't. If you saved and close it and close your visual studio and reopen it you can't. It doesn't appear on your Solution Explorer.
I just tried it. I can open it but I can't run the code.
How do you open the form and still in the form format and can still run the code ?
Yes you can, when VS is in the default configuration. If it doesn't work for you then either you changed the configuration or your IDE is broken. Either way, it should be clear that what you're seeing is not what is expected so it would help us to help you if we could see what you're seeing. Providing a screenshot in this situation would be helpful.
 
Back
Top Bottom