How do you add an existing form to a new project?

后端 未结 21 2141
予麋鹿
予麋鹿 2020-12-13 09:06

I have never been able to successfully add a Form from an existing file to a new project.

I read on a blog that you add just the *.cs file and the depen

21条回答
  •  时光取名叫无心
    2020-12-13 09:32

    I've just encountered similar issues when upgrading VisualBasic forms, going from VisualStudio 2010 to VisualStudio 2013. There appear to be two ways to add existing items.

    Problem: If I choose Main Window->Project->Add Existing Item and pull in only the file formname.vb, the result appears to be interpreted as code only (no designer), points to the original file (rather than taking a copy to the new project) and has other issues.

    Solution: If instead, I go to the Solution Explorer window, click to select the project (as opposed to the lower level objects in the tree) and then right click in the window, the resulting menu offers Add->Existing Item. Using this version works as expected, requiring only that I locate the formname.vb file. No manually copying files, no pointing to mulitple files, no editing scripts, etc. I'd guess the same applies for forms written in C.

提交回复
热议问题