これに似たテーブルレイアウトを作成しようとしています
---------------------------------------------------------------------
| 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);
例外はないので、うまくいくようですが、ひどいようです。テーブルの幅が短すぎて、上記のようにテキスト列が追加されていません。また、一部のテキストが下部で切り取られているため、テーブルの高さが短すぎるように感じます。
これに対するより良いアプローチはありますか?または、これらの問題に関する役立つチュートリアルですか?