locked
Problem with position of controls on Windows form RRS feed

  • Question

  • I am using Visual Studio 2015 Community. 

    I have two buttons at the bottom right of the form and their anchors are set to Bottom, Right.

    However when I save the solution and close Visual Studio and reopen the solution the buttons have moved up on the form. Every time I open the solution the buttons have moved up (Please see the picture). I have even tried locking the controls on the form.

    Can anyone assist me with this?


    • Moved by CoolDadTx Tuesday, June 14, 2016 1:50 PM Winforms related
    Tuesday, June 14, 2016 7:53 AM

Answers

  • Hi Novaleo,

    I follow your steps to create a test application, then I get the same result.

    Here is the test records:

    1. Anchor to 'Top,Left' other keep, not move.

    2. Controlbox to 'true' other keep, not move.

    3. All steps, moved.

    4. Not set MaxSize property, not move.

    5. Not set MinSize property, not move.

    I'm not so sure if it is a bug, perhaps you could post this issue to connect:

    https://connect.microsoft.com/visualstudio

    Regards,

    Moonlight


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Wednesday, June 15, 2016 6:43 AM

All replies

  • On further investigation it happens when I set a Minimum Size for the form. I created a new application and left everything at the default settings then it seems fine. The moment I set a Minimum size for the form the button position move up every time I close and open the solution in Visual Studio.

    Why would that be?

    Tuesday, June 14, 2016 11:13 AM
  • Hi Novaleo,

    Could you share me more detail info?(e.g. snipcode, action steps...)

    Have you used any methods to modify the position of the control or dynamic to set the control's layout? If you have, you could  disable them and try again.

    Regards,

    Moonlight


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Wednesday, June 15, 2016 12:53 AM
  • Hi Moonlight

    I have created a test Windows application and the following is what I have done:

    • In Visual Studio Community 2015 I create a new Windows Forms Application project.
    • I change the size of Form1 to (400; 200).
    • I set the MaximumSize of Form1 to (400; 200).
    • I set the MinimumSize of Form1 to (400; 200).
    • I add a Button at (280; 110).
    • I anchor the Button at (Bottom, Right)
    • I set the ControlBox property of Form1 to false.
    • I save and close the project.

    When I open the project again, the button has moved up. Location f the Button is now (280; 81).

    If I save and close the project with the new location of the button and open the project again, the Button has again moved up and new location is (280; 52).

    This was all just done in the Editor and I have not added any code of my own.

    Regards.

    Novaleo

    Wednesday, June 15, 2016 5:39 AM
  • Hi Novaleo,

    I follow your steps to create a test application, then I get the same result.

    Here is the test records:

    1. Anchor to 'Top,Left' other keep, not move.

    2. Controlbox to 'true' other keep, not move.

    3. All steps, moved.

    4. Not set MaxSize property, not move.

    5. Not set MinSize property, not move.

    I'm not so sure if it is a bug, perhaps you could post this issue to connect:

    https://connect.microsoft.com/visualstudio

    Regards,

    Moonlight


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Wednesday, June 15, 2016 6:43 AM