FlowLayoutPanel.WrapContents Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets a value indicating whether the FlowLayoutPanel control should wrap its contents or let the contents be clipped.
public:
property bool WrapContents { bool get(); void set(bool value); };
public bool WrapContents { get; set; }
member this.WrapContents : bool with get, set
Public Property WrapContents As Boolean
true
if the contents should be wrapped; otherwise, false
. The default is true
.
The following code example sets the value of the WrapContents property depending on the Checked value of a CheckBox control.
private:
void wrapContentsCheckBox_CheckedChanged(
System::Object^ sender, System::EventArgs^ e)
{
this->flowLayoutPanel1->WrapContents =
this->wrapContentsCheckBox->Checked;
}
private void wrapContentsCheckBox_CheckedChanged(
System.Object sender,
System.EventArgs e)
{
this.FlowLayoutPanel1.WrapContents =
this.wrapContentsCheckBox.Checked;
}
Private Sub wrapContentsCheckBox_CheckedChanged( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles wrapContentsCheckBox.CheckedChanged
Me.FlowLayoutPanel1.WrapContents = Me.wrapContentsCheckBox.Checked
End Sub
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.
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 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: