private TableLayoutPanel InitButtonTable (List <Button> buttons, int rowHeight, int rowSpan = 1, int columnWidth = 100) { var table = new TableLayoutPanel { GrowStyle = TableLayoutPanelGrowStyle.AddRows, AutoSize = true }; table.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, columnWidth)); table.AddControlsToRows(buttons, 0, 0, SizeType.Absolute, rowHeight, rowSpan); table.Dock = DockStyle.Top; return(table); }
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); }