TableLayoutControlCollection.Add Method (Control, Int32, Int32)
Adds the specified control to the collection and positions it at the specified cell.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
With Add, you can specify the cell position of control. You can assign control to a specific cell by providing both the column and row parameters, or you can specify only the column or row value and let the LayoutEngine place control at the next open cell. This is known as letting the control flow to its position in the TableLayoutPanel control.
Set column to -1 if you want control to occupy a fixed row position.
Set row to -1 if you want control to occupy a fixed column position.
If neither column nor row is -1, control will be added at the absolute position given by (column, row).
If you set both column and row to -1, control will flow to the first open position, with the specific flow behavior defined by the TableLayoutPanel.GrowStyle value. This is equivalent to using the Control.ControlCollection.Add method.
To get to the actual current position of a control, use the TableLayoutPanel.GetPositionFromControl method. This method takes into account the entire 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.
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.