我正在尝试构建一个类似于此的表布局
---------------------------------------------------------------------
| 01.01.2010 01:00 | 01.01.2010 01:00 | 01.01.2010 01:00 |
---------------------------------------------------------------------
| Some text | More | And | Final text |
| (Multilined) | multilined | more text | Multiple lines,|
| | text | | too |
---------------------------------------------------------------------
// The "outer" table - two rows (the dates and the texts)
TableLayoutPanel table = new TableLayoutPanel();
table.ColumnCount = 1;
table.RowCount = 2;
// Date table - three columns
TableLayoutPanel dateTable = new TableLayoutPanel();
dateTable.ColumnCount = 3;
dateTable.RowCount = 1;
// Text table - four columns
TableLayoutPanel textTable = new TableLayoutPanel();
textTable.ColumnCount = 4;
textTable.RowCount = 1;
// Add it all up and save it to the panel in the winform
table.Controls.Add(dateTable);
table.Controls.Add(textTable);
SomeUIPanel.Controls.Add(table);
它似乎起作用,因为我没有例外-但它看起来可怕。表格的宽度太短,文本列没有按照我上面描述的方式添加,我也有一种感觉,表格的高度太短,因为一些文本在底部被切掉了。
有更好的方法吗?或者关于这些问题的有用的教程?