System.Windows.Forms.TableLayoutPanel.GetPositionFromControl Method

Gets the System.Windows.Forms.TableLayoutPanelCellPosition that represents the row and the column of the cell that contains the control.

Syntax

public TableLayoutPanelCellPosition GetPositionFromControl (Control control)

Parameters

control
A control contained within a cell.

Returns

A System.Windows.Forms.TableLayoutPanelCellPosition that represents the cell position.

Remarks

The TableLayoutPanel.GetPositionFromControl(Control) method returns the actual current position of control, even if its position is determined by the TableLayoutPanel.LayoutEngine. This method takes into account the entire System.Windows.Forms.TableLayoutPanel control state, including column or row spanning and when the TableLayoutPanel.LayoutEngine has placed a control with its Column and Row properties set to -1. This is equivalent to the situation in which TableLayoutPanel.GetColumn(Control) and TableLayoutPanel.GetRow(Control) return -1.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0