I am puzzled by some strange behavior in the Visual Studio Form Editor. I saw this in several different forms in my application. Each time I open a form in the Visual Studio Layout Editor, some controls will be in a different place than when I left them. Typically, some buttons advance slightly from the lower right corner. But these are not just buttons, in one case it is a container panel that moves. I have to change them, then save and close the form. I confirmed that the layout editor actually changes the property Locationwhen the form is opened, because if I save and close the form using the buttons in the correct position, they will be correct at runtime.
This is not a problem with the correct property settings Anchoror Dock. The editor actually changes the property of Locationmy controls. I looked at the .designer.cs file and I see nothing unusual. I tried to delete and recreate these controls, but the problem persists.
Any ideas what I can do?
This is not an indicative stopper. I just need to very carefully capture the controls manually every time I open it in the winforms layout editor.
Edit: Visual Studio will actually check the file automatically to install Locationon what it stubbornly thinks it should be.
source
share