articles

Home / DeveloperSection / Articles / TableLayoutPanel Control in C#.Net

TableLayoutPanel Control in C#.Net

Pushpendra Singh21405 24-Jan-2011

The TableLayoutPanel control is a container of other control where child controls are added within a table structure. When you add a control to a cell of the table, it would reposition itself to the center of the cell.

How to use TableLayoutPanel Control

Drag and drop TableLayoutPanel from toolbox on the window Form.

TableLayoutPanel Control in C#.Net

We can add more row and column from collection property of TableLayoutPanel.

We can add other controls in TableLayoutPanel.

TableLayoutPanel Control in C#.Net

TableLayoutPanel can have only one control in each cell.

Here we cannot add more than one control in a cell.  If you want to add more control then you have to add new cell in TableLayoutPanel to do this first you have to add row or column in the TableLayoutPanel.

TableLayoutPanel properties

CellBorderStyle: This property determines if the cell is outlined with a border or not.

ColumnCount: Determines the number of columns in the table.

RowCount:  Determines the number of rows in the table.

Visible:  This property determines that TableLayoutPanel control is visible or not. By default it is true.  

Example:                     
private void frmTableLayoutPanel_Load(object sender, EventArgs e)
{
        //Hide TableLayoutPanel
        tableLayoutPanel1.Visible = false;
}

TableLayoutPanel will not visible  when application run.

TableLayoutPanel Control in C#.Net


Updated 07-Sep-2020

Leave Comment

Comments

Liked By