StackPanel.Orientation Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets a value that indicates the dimension by which child elements are stacked.
public:
property System::Windows::Controls::Orientation Orientation { System::Windows::Controls::Orientation get(); void set(System::Windows::Controls::Orientation value); };
public System.Windows.Controls.Orientation Orientation { get; set; }
member this.Orientation : System.Windows.Controls.Orientation with get, set
Public Property Orientation As Orientation
Property Value
The Orientation of child content.
Examples
The following example shows how to use the Orientation property to specify how elements within a StackPanel are stacked (one on top of the other or side by side).
Stacked Item #1
Stacked Item #2
Stacked Item #3
Stacked Item #1
Stacked Item #2
Stacked Item #3
The screenshot below shows how this example renders.

Remarks
Dependency Property Information
| Item | Value |
|---|---|
| Identifier field | OrientationProperty |
Metadata properties set to true |
AffectsMeasure |