Home > Mobile >  Winform lost all elements c#
Winform lost all elements c#

Time:07-23

I had a button1 with onclick already created something like

private void Button1_Click(object sender, EventArgs e)
        {
...code ...
}

I change the button name to "reloadConf" in the design view, after that I just change the name in the .cs file, after that I select in the properties of the design view the name of the new function, I mean I change the event Clic from "Button1_Click" to "ReloadConf_Click" from the list of functions.

After that I lost all the elements in the form and I just have an empty form. but in the designer is everything including the elements (buttons, labels...)

how can I recover the elements in the form?

hope someone can help me.

CodePudding user response:

Found the problem! In the Form1.Designer.cs all the elements that are after the button that I change the name, all the elements are not attached to form1, lost many properties, that exist before, and position is point(0,0). So basically is a mess. Will use a copy from 5 days ago, but I still will need to add the element that was not 5 days ago.

PS: I use this page web to compare both files designer.cs, diffchecker.com/diff

  • Related