I'm stumped by some bizarre behavior in Visual Studio's forms editor. I have seen this on a couple of different forms in my application. Each time I open the form in Visual Studio's layout editor some controls will be in a different location than when I left them. Typically some buttons move up just a little bit from the lower right corner. But its not just buttons, in one case its a container panel that moves. I have to reposition them then save and close the form. I've confirmed that it is the layout editor actually changing the Location
property when the form is opened because if I save and close the form with the buttons in the correct position they will be correct at runtime.
This is not a problem with the Anchor
or Dock
properties not being set correctly. The editor is actually changing the Location
property of my control(s). I've looked at the .designer.cs file and I do not see anything unusual. I've tried deleting and recreating these controls but the problem persists.
Any ideas what I can do?
Its not a show stopper I just have to be very careful to fix the controls manually every time I open it in the winforms layout editor.
Edit: Visual Studio will actually checkout the file automatically to set the Location
to what it stubbornly thinks it should be.