
You want to use TableLayoutPanel in Windows Forms to position your controls more precisely. You require an attractive and functional GUI that resizes properly when users change the size of the window. Here we see how you can use the TableLayoutPanel in Windows Forms.
Here we use the .NET Framework 3.5, but really this applies to many different configurations. First, to make a TableLayoutPanel, expand the toolbox on the left side. Double click on the TableLayoutPanel icon in the left, and then open the Properties pane on the right.
Four-pane panel. You should see a four-pane panel now, which you can position controls within. You will need to modify the number of columns and rows, and then you can also change row spans and column spans. Here are some properties that are available when using TableLayoutPanel.
Anchor
Used to align, expand, or fill a control.
Column
Used to specify number of columns.
Use for making new cells on the right.
Row
Specifies number of rows.
Add 1 to this to get a new row on the bottom.
GrowStyle
Could be useful for when you need more flexibility.

When you click on the space next to Anchor in the Property pane on the right, you will see a box that looks like a +. Click on the rectangles that make up the + and anchor the control that is within the table panel cell to that edge.
Note on the TextBox. The TextBox you made will now expand to fill the entire width. To create a multi-line TextBox that fills the entire cell, first set the TextBox as multiline, and then add Top and Bottom in the Anchor menu by clicking on the up and down parts of the +.
Align a control to any side of a cell
Set the appropriate Anchor property in the +
(But only that direction)
Expand the control to the full cell
Set all directions on the Anchor +
Center a control in a cellset no directions in the Anchor +
Set no directions in the Anchor +
Solving layout problems. TableLayoutPanel may solve almost all of the control alignment problems you have. TableLayoutPanel is quite flexible and can greatly enhance your program's UI, but it requires a planning step before dragging controls to your form. The cost of TableLayoutPanel is far less.
Here we saw general ways you can use TableLayoutPanel in .NET Windows Forms. I remind you that it is bad practice to make the layout rigid. Having a rigid layout makes life hard for you, as the designer, and the user who is trying to use the program in a slightly different configuration. You can use TableLayoutPanel to eliminate the tedious pixel adjustments.
Windows Forms