System.Windows.Forms.TableLayoutPanel.GetColumn Method

Returns the column position of the specified child control.

Syntax

[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.ComponentModel.DefaultValue(-1)]
[System.ComponentModel.DisplayName("Column")]
public int GetColumn (Control control)

Parameters

control
A child control of the System.Windows.Forms.TableLayoutPanel.

Returns

The column position of the specified child control, or -1 if the position of control is determined by TableLayoutPanel.LayoutEngine.

Remarks

If control spans two or more columns, the TableLayoutPanel.GetColumn(Control) method will return the lowest column index.

The column position value is zero based, so you can use it as an index for the array returned by TableLayoutPanel.GetColumnWidths.

This method is called by the Column property, which the panel adds to its child controls at design time.

To get the actual position of control, even when its position is determined by TableLayoutPanel.LayoutEngine, call the TableLayoutPanel.GetPositionFromControl(Control) method.

Requirements

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