You need to use the property
Dock
of your control, with the value other then
System.Windows.Forms.DockStyle.None
(which is the default):
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.dock.aspx[
^],
http://msdn.microsoft.com/en-us/library/system.windows.forms.dockstyle.aspx[
^].
In this case, the control will be resized automatically.
One comment to the suggestion of joshrduncan2012 to use
Anchor
: they are often useful, but in most cases, prefer docking approach. Some controls tend to flicker during resize operation if anchored. Also, it's more of a manual work or coding: you would need to take care about position and size at the same time, for symmetry, and bad for maintenance. With docking approach, this is not a problem: use it with
Padding
:
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.padding.aspx[
^],
http://msdn.microsoft.com/en-us/library/system.windows.forms.padding.aspx[
^].
—SA