How to reduce the height and width of particular row of panel inside tablelayoutpanel?

654 views Asked by At

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.
1

There are 1 answers

6
Sinatr On

Its is very simple to use TableLayoutPanel at run-time (also called in code behind). Basically repeating msdn (in simpler words I hope):

  • use ColumnCount/ColumnStyles and RowCount/RowStyles to setup TableLayoutPanel itself (as you do it in the form designer);
  • use methods SetColumn(control, column) and SetRow(control, row) to put some existing control into specific cell;
  • use methods GetColumn/GetRow to check where some control is located;
  • use method 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 .