Reputation: 6084
When using the IDE, I notice that I can no longer open the designer view of certain forms. As seen in the screen shot attached, there is no "View Designer" in the pop-up menu. I didn't touch those files during this round of programming, so it should be the system that did the favor (or by my accident). I search online and although it is not a new question the solutions that I have found don't quite seem to work or maybe not intuitive enough for me to understand.
For example, one suggests to run "devenv" with either a skip or reset option. But I cannot find this program in my system (Windows 10 + Studio 2015). Other suggests to create new form and copy then delete old form, which I am not convinced and due to its manual complexity I would prefer something more simple if possible (what if it keeps happening in the future?).
Thank you very much for the help.
Follow the suggestion by Visual Vincent (i.e., delete all form files, re-add them, and add two lines in the form file), not quite work. Here is the screen shot.
Note "Form3", after re-adding, the file hierarchy becomes different.
Upvotes: 0
Views: 5055
Reputation: 457
I'm using C# but had the same problem. For me it turns out that I had declared other classes before my form class declaration ("public partial class MyForm: Form"). As soon as I moved those class declarations to the end of the file I could view the form designer again. Note:It is considered good practice to have such declarations in their own file.
Upvotes: 1
Reputation: 11801
As has been stated by Hans Passant, it is likely that your ProjectName.vbproj
file has become damaged in some manner. Most likely the <DependentUpon>
tag was deleted from the entries of the constituent files of your Form3.
You can try to edit the project file yourself or you can try the following procedure.
Edit: In response to the comment about the Exclude From/Include In Project Solution Explorer options not existing in VS2015, I am adding this image. Note that you can also select those items via the Project Menu dropdown.
Upvotes: 2