FlowLayoutPanel.WrapContents 屬性

定義

取得或設定值,指出 FlowLayoutPanel 控制項是應該將其內容換行還是裁剪內容。

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,否則為 false。 預設為 true

範例

下列程式碼範例會根據控制項的值 WrapContents 來設定 屬性的值 CheckBoxChecked

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

備註

如果面板的區域太小而無法包含其所有子控制項,則不論包裝模式為何,至少會裁剪一個子控制項。

面板的後續調整大小會將配置重新套用至包含的控制項。

適用於

另請參閱