FlowDirection 枚举
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
定义指定连续用户界面 (UI) 元素放置在线性布局容器中的方向的常量。
public enum class FlowDirection
public enum FlowDirection
type FlowDirection =
Public Enum FlowDirection
- 继承
字段
| 名称 | 值 | 说明 |
|---|---|---|
| LeftToRight | 0 | 元素从设计图面的左边缘向右流动。 |
| TopDown | 1 | 元素从设计图面的顶部流向底部。 |
| RightToLeft | 2 | 元素从设计图面的右边缘流向左。 |
| BottomUp | 3 | 元素从设计图面底部流向顶部。 |
示例
以下示例演示如何在控件上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 将新控件添加到支持容器时默认放置的位置。 容器的流方向以及AnchorDock每个包含控件的属性在调整其容器大小时确定控件的重新排列。
该 FlowLayoutPanel 控件为其子控件提供 FlowBreak 属性。 将属性的值 FlowBreak 设置为 true 使 FlowLayoutPanel 控件停止在当前流方向中布局控件,并换行到下一行或列。