top button
Flag Notify
Site Registration

what is Stack Panel Layout in XAML??

+3 votes
320 views
what is Stack Panel Layout in XAML??
posted Nov 14, 2014 by Karthi Kumar

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Understanding Stack Panel Layout

 1. Lays out element by stacking them one after the other.
 2. Items can either be stacked vertically or horizontally. 
 3. By default items are stacked vertical. 
 4. Thus stack panel control is used in positioning control in either a row or column format. 
 5. They are mostly used to arrange a small subsection of UI.

Example of Stack Panel Layout

Note: By Default Items in Stack Panel are aligned Vertically

XAML Code:

  <StackPanel>
    <TextBlock Text="Stack Panel Demo" 
        FontSize="30" FontWeight="Bold"
        Foreground="Red"/>
    <TextBlock Text="QueryHome" FontSize="20" FontWeight="Bold" Height="70" />
    <TextBlock Text="QueryHome" FontSize="25" FontWeight="Bold" Height="87" />
    <TextBlock Text="QueryHome" FontSize="30" FontWeight="Bold" Height="104" />
</StackPanel>

OUTPUT:

enter image description here

answer Nov 17, 2014 by Jdk
...