The Anchor property in Windows Forms allows resizable user interfaces. When you anchor a control to the top, bottom, left, or right, it will resize to keep the same distance from that edge if the user resizes the window.

This article describes the Anchor property in Windows Forms.

To get started using the Anchor property, you can add a control such as a Button to your Window in Visual Studio. Then, right-click on the Button in and select Properties. You will see the Anchor property in the list. You can use the buttons to anchor the control to a specific side, or a combination of sides.

When you create a Windows Forms application, the default layout system will not resize the individual controls when the user resizes the window. The default size of the controls is set in the designer, but if the default size of the enclosing window changes, they will not expand or shrink. Therefore, Anchor should always be used when the enclosing window might be resized in your program; this keeps the visual design consistent and results in a more polished program.
Understanding the Anchor property in Windows Forms is an essential part of creating high-quality and durable user interfaces. By accounting for resizes of the window, the Anchor property results in consistent control resizes as well.
Windows Forms