(i) TableLayoutPanel height and width run-time adjustment
(1) Set the height of the first line:
Relative size:
Tablelayoutpanel1.rowstyles[0]. SizeType = sizetype.percent;
Tablelayoutpanel1.rowstyles[0]. Height = 10F;
Absolute size:
Tablelayoutpanel1.rowstyles[0]. SizeType = Sizetype.absolute;
Tablelayoutpanel1.rowstyles[0]. Height = 240F;
(2) Set the width of the first column:
Relative size:
Tablelayoutpanel1.rowstyles[0]. SizeType = Sizetype.absolute;
tablelayoutpanel1.columnstyles.width=240f;
Absolute size:
Tablelayoutpanel1.rowstyles[0]. SizeType = sizetype.percent;
tablelayoutpanel1.columnstyles.width=20f;
(ii) TableLayoutPanel points of attention in the layout:
1, a space across the line display
For example, if a panel control wants to fill all the rows of the first column, the panel's rowspan is set to the number of rows that it wants to fill, and all the columns that fill a row are similar
2. Adjust the controls in TableLayoutPanel cells
For example, if a GroupBox control wants it to be in the second row of Tablelayout, set its properties row=1,column=1
Use of Tablelayout