TableLayoutPanel::SetRow Method (Control^, Int32)

 

Sets the row position of the specified child control.

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

public:
void SetRow(
	Control^ control,
	int row
)

Parameters

control
Type: System.Windows.Forms::Control^

The control to move to another row.

row
Type: System::Int32

The row to which control will be moved.

The SetRow method moves the control to another row in the TableLayoutPanel control. The columns and rows have zero-based indexes. Setting the row position to -1 specifies that the control will flow to the first empty cell.

This method reapplies the table layout to all controls in the TableLayoutPanel.

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

The following code example uses the SetColumn method to swap two controls contained within a TableLayoutPanel control. The example assumes a TableLayoutPanel control with at least two rows.

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

.NET Framework
Available since 2.0
Return to top
Show: