Windows form controls are gone

I have a windows project that seems to have lost all the controls in the design view. When I start the project, the controls are displayed as they should. For this form in the visual studio, only the design view is violated, all other forms are the same.

I tried to open the solution again and open the file again. I also tried cleaning and restoring the solution to no avail. I made a video capture describing the problem

What should I do next?

+4
source share
5 answers

VS 2017, yourForm.Designer.cs , , .

+3

, , , , / . , ( x86 x64)

+2

, , (, program.cs)

+2

( , , , .)

, designer.cs.

, initializeComponent() :

    private void InitializeComponent()
    {
        this.SuspendLayout();

        this.ResumeLayout(false);
        this.PerformLayout();
    }

, : listBox1:

private void InitializeComponent()
    {
        this.listBox1 = new System.Windows.Forms.ListBox();
        this.SuspendLayout();

        // 
        // listBox1
        // 
        this.listBox1.FormattingEnabled = true;
        this.listBox1.Location = new System.Drawing.Point(10, 10);
        this.listBox1.Name = "listBox1";
        this.listBox1.Size = new System.Drawing.Size(133, 43);
        this.listBox1.TabIndex = 5;

        // 
        // Form1
        // 
        this.ClientSize = new System.Drawing.Size(550, 430);
        this.Controls.Add(this.listBox1);

        this.Name = "Form1";
        this.Load += new System.EventHandler(this.Form1_Load);
        this.ResumeLayout(false);
        this.PerformLayout();

    }

, , . , 10,10 x, y, . . . , , , Visual Studio .

, InitializeComponent():

    #endregion
    private System.Windows.Forms.ListBox listBox1;

: , designer.cs , , , .

:)

+2

, , designer.cs . .cs. , " " , , (.cs) . .

0

Source: https://habr.com/ru/post/1543296/


All Articles