Language

StackPanel.Orientation Property

Definition

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.

StackPanel orientation

Remarks

Dependency Property Information

Item Value
Identifier field OrientationProperty
Metadata properties set to true AffectsMeasure

Applies to