TableLayoutPanel.GetControlFromPosition Method (Int32, Int32)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Returns the child control occupying the specified position.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

member GetControlFromPosition : 
        column:int *
        row:int -> Control


Type: System.Int32

The column position of the control to retrieve.

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

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.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top