简体   繁体   中英

Different cell sizes in a Windows Forms TableLayoutPanel

In Windows Forms, how do I make it so that the TableLayoutPanel will contain different cell sizes (either for rows and/or columns)?

For example: row 1 might have only 1 cell, row 2 might have 5, row 3 might have 5 again, but with different column sizes.

You cannot choose the number of columns per individual row, nor vice versa. What you can do, however, is to have controls on the TableLayoutPanel span across several cells in either direction.

Therefore, choose the required number of rows and columns & their sizes to set up the desired "grid" structure, then set the RowSpan and ColumnSpan properties on individual controls placed in the panel cells to combine these cells to larger ones. (These "foreign" properties get attached by the panel to controls placed in its cells).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM