question

bsabiston avatar image
0 Votes"
bsabiston asked cooldadtx answered

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

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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

cooldadtx avatar image
0 Votes"
cooldadtx answered

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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.