FlowLayoutPanel.FlowDirection 属性

定义

获取或设置一个值,该值指示 FlowLayoutPanel 控件的流向。

public:
 property System::Windows::Forms::FlowDirection FlowDirection { System::Windows::Forms::FlowDirection get(); void set(System::Windows::Forms::FlowDirection value); };
public System.Windows.Forms.FlowDirection FlowDirection { get; set; }
member this.FlowDirection : System.Windows.Forms.FlowDirection with get, set
Public Property FlowDirection As FlowDirection

属性值

FlowDirection

FlowDirection 值之一,指示控件在面板中的连续放置方向。 默认值为 LeftToRight

示例

下面的代码示例设置值,具体取决于所选RadioButtonFlowDirection

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 属性是类的默认属性 FlowLayoutPanel

适用于

另请参阅