FlowDirection 列舉

定義

定義常數,指定在線性配置容器內放置連續使用者介面 (UI) 元素的方向。

public enum class FlowDirection
public enum FlowDirection
type FlowDirection = 
Public Enum FlowDirection
繼承
FlowDirection

欄位

BottomUp 3

項目會從設計介面的底端流向頂端。

LeftToRight 0

項目會從設計介面的左邊緣流向右邊。

RightToLeft 2

項目會從設計介面的右邊緣流向左邊。

TopDown 1

項目會從設計介面的頂端流向底端。

範例

下列範例示範如何在 控制項上 FlowLayoutPanel 設定 FlowDirection 屬性。 此程式碼範例是控制項所提供較大範例的 FlowLayoutPanel 一部分。

private:
    void flowTopDownBtn_CheckedChanged(System::Object^ sender,
        System::EventArgs^ e)
    {
        this->flowLayoutPanel1->FlowDirection = FlowDirection::TopDown;
    }

private:
    void flowBottomUpBtn_CheckedChanged(System::Object^ sender,
        System::EventArgs^ e)
    {
        this->flowLayoutPanel1->FlowDirection = FlowDirection::BottomUp;
    }

private:
    void flowLeftToRight_CheckedChanged(System::Object^ sender,
        System::EventArgs^ e)
    {
        this->flowLayoutPanel1->FlowDirection =
            FlowDirection::LeftToRight;
    }

private:
    void flowRightToLeftBtn_CheckedChanged(
        System::Object^ sender, System::EventArgs^ e)
    {
        this->flowLayoutPanel1->FlowDirection =
            FlowDirection::RightToLeft;
    }
private void flowTopDownBtn_CheckedChanged(
    System.Object sender, 
    System.EventArgs e)
{
    this.FlowLayoutPanel1.FlowDirection = FlowDirection.TopDown;
}

private void flowBottomUpBtn_CheckedChanged(
    System.Object sender, 
    System.EventArgs e)
{
    this.FlowLayoutPanel1.FlowDirection = FlowDirection.BottomUp;
}

private void flowLeftToRight_CheckedChanged(
    System.Object sender, 
    System.EventArgs e)
{
    this.FlowLayoutPanel1.FlowDirection = FlowDirection.LeftToRight;
}

private void flowRightToLeftBtn_CheckedChanged(
    System.Object sender, 
    System.EventArgs e)
{
    this.FlowLayoutPanel1.FlowDirection = FlowDirection.RightToLeft;
}
Private Sub flowTopDownBtn_CheckedChanged( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles flowTopDownBtn.CheckedChanged

    Me.FlowLayoutPanel1.FlowDirection = FlowDirection.TopDown

End Sub

Private Sub flowBottomUpBtn_CheckedChanged( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles flowBottomUpBtn.CheckedChanged

    Me.FlowLayoutPanel1.FlowDirection = FlowDirection.BottomUp

End Sub

Private Sub flowLeftToRight_CheckedChanged( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles flowLeftToRight.CheckedChanged

    Me.FlowLayoutPanel1.FlowDirection = FlowDirection.LeftToRight

End Sub

Private Sub flowRightToLeftBtn_CheckedChanged( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles flowRightToLeftBtn.CheckedChanged

    Me.FlowLayoutPanel1.FlowDirection = FlowDirection.RightToLeft

End Sub

備註

列舉 FlowDirection 描述設計介面或容器上連續 UI 元素的流程方向,通常是控制項,例如表單。 線性配置容器會使用此列舉,例如 FlowLayoutPanel ,這會在 屬性內部 FlowLayoutPanel.FlowDirection 儲存此資訊。

FlowDirection 決定新增至支援容器時,預設會放置新控制項的位置。 容器的流程方向,以及 Anchor 每個自主控制項的 和 Dock 屬性,決定其容器調整大小時的控制項重新排列。

控制項 FlowLayoutPanel 會為其子控制項提供 FlowBreak 屬性。 將 屬性的值 FlowBreak 設定為 , trueFlowLayoutPanel 控制項停止在目前的流程方向配置控制項,並換行至下一個資料列或資料行。

適用於

另請參閱