TableLayoutPanel::GetControlFromPosition Method (Int32, Int32)
.NET Framework (current version)
Returns the child control occupying the specified position.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Parameters
- column
-
Type:
System::Int32
The column position of the control to retrieve.
- row
-
Type:
System::Int32
The row position of the control to retrieve.
Return Value
Type: System.Windows.Forms::Control^The child control occupying the specified cell; otherwise, null if no control exists at the specified column and row, or if the control has its Visible property set to false.
| Exception | Condition |
|---|---|
| ArgumentException | Either column or row (or both) is less than 0. |
The column and row position values are zero based.
The following code example enumerates all the cell positions in the TableLayoutPanel by looping through the columns and rows given by ColumnCount and RowCount, and then calling the GetControlFromPosition method to retrieve the control at each cell.
.NET Framework
Available since 2.0
Available since 2.0
Show: