FlowDirection 列舉
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
定義常數,指定連續使用者介面 (UI) 元素放置於線性配置容器的方向。
public enum class FlowDirection
public enum FlowDirection
type FlowDirection =
Public Enum FlowDirection
- 繼承
欄位
| 名稱 | 值 | Description |
|---|---|---|
| LeftToRight | 0 | 元素從設計表面的左邊緣流向右側。 |
| TopDown | 1 | 元素從設計表面的頂部流向底部。 |
| RightToLeft | 2 | 元素從設計表面的右邊緣流向左側。 |
| BottomUp | 3 | 元素從設計表面的底部流向頂部。 |
範例
以下範例說明如何在控制項上設定該 FlowDirection 屬性 FlowLayoutPanel 。 此程式碼範例是控制項所提供 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 項會停止依目前流向排列控制項,並繞行到下一列或下一欄。