简体   繁体   English

Windows窗体TableLayoutPanel中的不同单元格大小

[英]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)? 在Windows窗体中,如何使TableLayoutPanel包含不同的单元格大小(行和/或列)?

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. 例如:第1行可能只有1个单元格,第2行可能只有5个,第3行可能再次有5个,但具有不同的列大小。

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. 但是,你可以做的是在TableLayoutPanel上控制跨越任意一个方向的几个单元格。

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. 因此,选择所需的行数和列数及其大小以设置所需的“网格”结构,然后在面板单元格中放置的各个控件上设置RowSpanColumnSpan属性 ,以将这些单元格组合为较大的单元格。 (These "foreign" properties get attached by the panel to controls placed in its cells). (这些“外来”属性由面板附加到放置在其单元格中的控件)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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