Why does Visual Studio automatically changes the layout of my form?
<p>I have a Windows form which consists of 3 files:</p>

<ul>
<li><p><strong>AbcFrm.cs</strong></p></li>
<li><p><strong>AbcFrm.Designer.cs</strong></p></li>
<li><p><strong>AbcFrm.resx</strong></p></li>
</ul>

<p>Whenever I do a little change to any properties of datagridview or add new events, the size of the controls grows larger to the right and bottom side and causes some part of the controls to go out of bounds. </p>

<p>I have compared the .Designer.cs file before and after I perform a minor property change (e.g. change a datagridview's tabStop property value from true to false) and discovered some lines/properties were added/changed automatically in the .Designer.cs file :</p>

<ul>
<li>some controls' <code>.Size</code> value changes</li>
<li>some controls' <code>.Location</code> value changes</li>
<li>some controls' <code>.Padding</code> value changes</li>
<li>the form's <code>.AutoScaleDimensions</code> becomes larger</li>
<li>the form's <code>.ClientSize</code> becomes larger</li>
</ul>

<p><strong>Edit</strong></p>

<p>I realize when I change the resolution from 150% to 125% and reopen the application, the controls are back in the correct place due to the windows form is now having a larger scaling size. My problem is similar <a href="https://social.msdn.microsoft.com/Forums/en-US/0cf09f01-9975-4705-9c8a-669bd60f15db/autoscaledimensions-in-designercs-changes-from-96-to-120-automatically?forum=netfxcompact" rel="noreferrer">to this question</a></p>

<p>The cause is that the code might have been edited in a computer with different resolution. However, the solution is not satisfying as it does not solves the problem, only identifying the cause.</p>

<p>How do I prevent this from happening? I'm using Visual Studio 2010 and my OS is Windows 10.</p>