TableLayoutPanel::GetControlFromPosition Method (Int32, Int32)

 

Returns the child control occupying the specified position.

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

public:
Control^ GetControlFromPosition(
	int column,
	int row
)

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.

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

.NET Framework
Available since 2.0
Return to top
Show: