[Solved] The *Design.cs file will reset automatically and delete the manually writed codes?


There are 2 Files for you Form:

MyFormClass.cs here you can edit as you like, add Properties, change them, etc.

MyFormClass.designer.cs // auto generated, dont put stuff here

Put your custom code in the constructor after the InitializeComponent() call

public MyFormClass()
{
    InitializeComponent();
    // do it here
    this.lblName.Top = 10;
    this.lblFamily.Top = this.lblName.Top + this.lblName.Height + 15;
}

It is the 2nd half of the partial class definition, so you have acces to all the Properties.

File1:

namespace Test{
    public partial class MyFormClass{
    // add some code
    }
}

File2:

namespace Test{
public partial class MyFormClass{
    // add some code here
    }
}

8

solved The *Design.cs file will reset automatically and delete the manually writed codes?