StackPanel.Orientation property

Applies to Windows and Windows Phone

Gets or sets the dimension by which child elements are stacked.

Syntax


public Orientation Orientation { get; set; }


<StackPanel Orientation="Horizontal"/>
-or-
<StackPanel Orientation="Vertical"/>

Property value

Type: Orientation

One of the enumeration values that specifies the orientation of child elements. The default is Vertical.

Examples

The following example creates a horizontal list of items by setting the Orientation property to Horizontal.


<StackPanel Orientation="Horizontal" Margin="20">
    <Rectangle Fill="Red" Width="50" Height="50" Margin="5" />
    <Rectangle Fill="Blue" Width="50" Height="50" Margin="5" />
    <Rectangle Fill="Green" Width="50" Height="50" Margin="5" />
    <Rectangle Fill="Purple" Width="50" Height="50" Margin="5" />
</StackPanel>


Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]

Metadata

Windows.winmd

See also

StackPanel

 

 

Show:
© 2014 Microsoft