FlowDirection FlowDirection FlowDirection FlowDirection Enum

定义

定义指定方向的常量,连续的用户界面 (UI) 元素将按照该方向放入线性布局容器中Defines constants that specify the direction in which consecutive user interface (UI) elements are placed in a linear layout container

public enum class FlowDirection
public enum FlowDirection
type FlowDirection = 
Public Enum FlowDirection
继承
FlowDirectionFlowDirectionFlowDirectionFlowDirection

字段

BottomUp BottomUp BottomUp BottomUp 3

元素从设计图面的底部流到顶部。Elements flow from the bottom of the design surface to the top.

LeftToRight LeftToRight LeftToRight LeftToRight 0

元素从设计图面的左边缘流到右边缘。Elements flow from the left edge of the design surface to the right.

RightToLeft RightToLeft RightToLeft RightToLeft 2

元素从设计图面的右边缘流到左边缘。Elements flow from the right edge of the design surface to the left.

TopDown TopDown TopDown TopDown 1

元素从设计图面的顶部流到底部。Elements flow from the top of the design surface to the bottom.

示例

下面的示例演示如何FlowDirection FlowLayoutPanel在控件上设置属性。The following example shows how to set the FlowDirection property on a FlowLayoutPanel control. 此代码示例是为FlowLayoutPanel控件提供的更大示例的一部分。This code example is part of a larger example provided for the FlowLayoutPanel control.

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 元素 (通常为控件) 的流动方向。The FlowDirection enumeration describes the flow direction of consecutive UI elements, typically controls, on a design surface or container such as a form. 线性布局容器使用此枚举FlowLayoutPanel, 例如, 在内部将FlowLayoutPanel.FlowDirection此信息存储在属性中。This enumeration is used by linear layout containers such as FlowLayoutPanel, which stores this information internally in the FlowLayoutPanel.FlowDirection property.

确定FlowDirection在将新控件添加到支持容器中时, 该控件的默认放置位置。The FlowDirection determines where a new control is placed by default when it is added to a supporting container. 容器的流方向连同Anchor每个包含的控件的和Dock属性, 确定调整控件的容器大小时控件的重新排列。The flow direction of the container, along with the Anchor and Dock properties of each contained control, determine the rearrangement of controls when their container is resized.

控件向其子控件FlowBreak提供属性。 FlowLayoutPanelThe FlowLayoutPanel control provides a FlowBreak property to its child controls. FlowBreak属性的值设置为true将导致FlowLayoutPanel控件停止在当前流方向布局控件, 并换行到下一行或第一列。Setting the value of the FlowBreak property to true causes the FlowLayoutPanel control to stop laying out controls in the current flow direction and wrap to the next row or column.

适用于

另请参阅