Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

FlowDirection Enumeration

Defines constants that specify the direction in which consecutive user interface (UI) elements are placed in a linear layout container

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

public enum FlowDirection
public enum FlowDirection
public enum FlowDirection
 Member nameDescription
BottomUpElements flow from the bottom of the design surface to the top. 
LeftToRightElements flow from the left edge of the design surface to the right. 
RightToLeftElements flow from the right edge of the design surface to the left. 
TopDownElements flow from the top of the design surface to the bottom. 

The FlowDirection enumeration describes the flow direction of consecutive UI elements, typically controls, on a design surface or container such as a form. This enumeration is used by linear layout containers such as FlowLayoutPanel, which stores this information internally in the FlowLayoutPanel.FlowDirection property.

The FlowDirection determines where a new control is placed by default when it is added to a supporting container. 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.

The FlowLayoutPanel control provides a FlowBreak property to its child controls. 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.

The following example shows how to set the FlowDirection property on a FlowLayoutPanel control. 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(Object sender,
    System.EventArgs e)
{
    this.flowLayoutPanel1.set_FlowDirection(FlowDirection.TopDown);
} //flowTopDownBtn_CheckedChanged

private void flowBottomUpBtn_CheckedChanged(Object sender,
    System.EventArgs e)
{
    this.flowLayoutPanel1.set_FlowDirection(FlowDirection.BottomUp);
} //flowBottomUpBtn_CheckedChanged

private void flowLeftToRight_CheckedChanged(Object sender, 
    System.EventArgs e)
{
    this.flowLayoutPanel1.set_FlowDirection(FlowDirection.LeftToRight);
} //flowLeftToRight_CheckedChanged

private void flowRightToLeftBtn_CheckedChanged(Object sender,
    System.EventArgs e)
{
    this.flowLayoutPanel1.set_FlowDirection(FlowDirection.RightToLeft);
} //flowRightToLeftBtn_CheckedChanged

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.