/// <summary> /// Adjust the width and height of the column where the <paramref name="control" /> is defined. /// </summary> /// <param name="tablePanel">TablePanel containing the button</param> /// <param name="control">Control to resize</param> /// <param name="width">Optional width of the button. If null, the width will remain as is</param> /// <param name="height">Optional height of the button. If null, the height will remain as is</param> public static void AdjustControlSize(this TablePanel tablePanel, Control control, int?width = null, int?height = null) { var row = tablePanel.RowFor(control); var col = tablePanel.ColumnFor(control); if (width.HasValue) { col.Style = TablePanelEntityStyle.Absolute; col.Width = width.Value + control.Margin.Horizontal; control.Width = width.Value; } if (height.HasValue) { row.Style = TablePanelEntityStyle.Absolute; row.Height = height.Value + control.Margin.Vertical; control.Height = height.Value; } }