I can remember having to write the code to resize control in forms. These days Microsoft have made it much easier with the Anchor property.
When you put a control on a form, e.g. a listbox, you’ll find that by default resizing the form leaves the control the same distance from the top and left-hand side of the form:
If you select the ListBox, then in the properties go and click on the Anchor property you will see this:
The greyed out boxes show that the control is pinned to the form at these places, i.e. the Left and the Top.
So, if we want the control to expand horizontally when we expand the form we can click on the right-hand box to pin the control to that side of the form as well:
With the right side of the control pinned resizing the form pulls the right hand edge of the control with it:
Removing the pinning on the left-hand edge of the control:
Will allow the control to be dragged with the form when resized:
You can experiment with different combinations of Anchors to see what effects they have.