Anchor property window form is for the alignment of form components in the window. It allows us to position the window components (text box, button, grid, etc.) according to our requirement.
I have a window form application that is used in my previous blog “How to establish database connection with MySQL in C# through App.config”, let’s use it.
Now run the application and resize or maximize the window and see what happens.
Normal state:-

After resize:

By default it set to Top, Left. And in property it looks like this.
To align the component to Bottom, Right of the window, select bottom and right sides.
Run the project again and see the changes are working or not.
Normal state:



Join the conversation! Your thoughts help the community grow.