0
TableLayoutPanel t = new TableLayoutPanel();
t.RowStyles.Add(new RowStyle(SizeType.AutoSize));
t.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100));
t.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single;
Label lbl = new Label();
lbl.Margin = new System.Windows.Forms.Padding(20, 150, 20, 20);
lbl.Text = "Hello";
t.Controls.Add(lbl, 0, 0);
this.Text = t.Size.Height.ToString();
this.Controls.Add(t);
왜 t.Size.Height 속성이 항상 100을 제공합니까?TableLayoutPanel 높이 속성이 작동하지 않습니다.
자동 크기 조정이 마음에 들지 않으면 AutoSize를 true로 설정하지 마십시오. –