public static void AddControlsToRows( this TableLayoutPanel table, IReadOnlyList <Control> controls, int column, int rowFrom, SizeType rowSizeType, int rowSize, int rowSpan = 1) { table.AddRows(controls.Count * rowSpan, rowSizeType, rowSize); table.AddControls(controls, column, rowFrom, rowSpan); }
private TableLayoutPanel InitTable() { var table = new TableLayoutPanel(); var controls = InitControls(); table.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 30)); table.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 60)); table.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 10)); table.AddControlsToRows(controls, 1, 0, SizeType.Absolute, 40); table.AddControls( controls.Select(c => c.Name).Select(Elements.GetLabel).ToList(), 0, 0); table.RowStyles.Add(new RowStyle(SizeType.Absolute, 100)); table.Controls.Add(GetPerformButton(), 0, 7); table.Controls.Add(GetOpenFileButton(), 2, 0); table.Dock = DockStyle.Fill; return(table); }