FlowLayoutPanel.WrapContents Property

Definition

Gets or sets a value indicating whether the FlowLayoutPanel control should wrap its contents or let the contents be clipped.

C#
public bool WrapContents { get; set; }

Property Value

true if the contents should be wrapped; otherwise, false. The default is true.

Examples

The following code example sets the value of the WrapContents property depending on the Checked value of a CheckBox control.

C#
private void wrapContentsCheckBox_CheckedChanged(
    System.Object sender, 
    System.EventArgs e)
{
    this.FlowLayoutPanel1.WrapContents = 
        this.wrapContentsCheckBox.Checked;
}

Remarks

If the area of the panel is too small to contain all its child controls, at least one child control will be clipped regardless of the wrapping mode.

Subsequent resizing of the panel will reapply the layout to the contained controls.

Applies to

Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

See also