How to stop VS from changing layout of child controls when I resize parent form?

bsabiston 1 Reputation point
2022-09-20T16:58:00.39+00:00

I have a windows form with a bunch of controls. All the controls have their anchors and docks set to not resize or change, but increasing the height of the parent form causes some of the children to move down. I cannot figure out what is causing this. How can I stop it?

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,826 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Michael Taylor 47,806 Reputation points
    2022-09-20T17:35:36.947+00:00

    By default they won't. However if you've mucked with the anchor/dock then that impacts rendering. There are also some containers (like FlowLayoutPanel) that impact this.

    Given your description it sounds like the impacted controls have their Anchor property set to Bottom. Note that Anchor must be set to something and the default of Top, Left should prevent the controls from moving anywhere as Top, Left of the parent never changes.

    0 comments No comments