Unable to get the designer view window back using windows forms with Visual Studio 2010

后端 未结 15 1638
逝去的感伤
逝去的感伤 2020-12-20 11:08

I am in process of writing a C# Windows Forms application using Visual Studio Express 2010 ENU SP1. Further VS specifics are at the bottom of this post. I recently made so

相关标签:
15条回答
  • 2020-12-20 11:53

    I accidentally deleted my Form1[Design] file. Double clicking the Form1.h file did nothing. The program ran and the Buttons TextBoxes and Labels were all there just no Form1[Design] was visible to edit. I fixed it Under: Header Files select Form1.h and go to Form1.H file properties. Under File Type from the drop down change it to "C++ Form" I closed and restarted the program. You should now be able to double click Form1.h and see your Form1[design].

    0 讨论(0)
  • 2020-12-20 11:59

    Just one more way to screw up the form designer - I had something like this:

    namespace MyProgram
    {
        public struct SomeStruct {
            int a,b;
        }
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }
        }
    }
    

    Turns out you can't put the SomeStruct definition there even though everything works fine and there were no errors. Once I moved it, I was able to see the designer view again.

    0 讨论(0)
  • 2020-12-20 11:59

    I had a similar issue, but not quite the same.

    I copied a form from one project to another (using windows explorer) and then added it to the new project by right clicking on the project in VS and choosing > Add > Existing Item.

    My mistake was to add all three files for the form (.cs, .designer.cs and .resx). I should have only added the .cs file.

    0 讨论(0)
提交回复
热议问题