I am using one
tablelayoutpanel
in which i have added one panel, Now i want to get that panel at run time and want to reduce the width of panel by half and then add another panel with the same size.
In simple words i want to make two square of panel inside that tablelayoutpanel row.
No. of column = 1,No. of rows = 2
Need : Add multiple controls with same size inside any row of the
tablelayoutpanel.
Its is very simple to use
TableLayoutPanel
at run-time (also called in code behind). Basically repeating msdn (in simpler words I hope):ColumnCount
/ColumnStyles
andRowCount
/RowStyles
to setupTableLayoutPanel
itself (as you do it in the form designer);SetColumn(control, column)
andSetRow(control, row)
to put some existingcontrol
into specific cell;GetColumn
/GetRow
to check where some control is located;GetControlFromPosition(column, row)
to get which control is located in given cell.Feel free to ask questions in comments if something is not clear so we can go through .