StackPanel with StackPanel : StackPanel « Windows Presentation Foundation « C# / C Sharp






StackPanel with StackPanel

StackPanel with StackPanel
    


<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      WindowTitle="StackPanel Sample">

    <StackPanel>
        <TabControl MinHeight="500" MinWidth="400">
            <TabItem Header="StackPanel" IsSelected="true">
                <StackPanel>
                    <Border Background="Red" BorderBrush="Black" BorderThickness="1">
                        <TextBlock Foreground="black" FontSize="12">Stacked Item #1</TextBlock>
                    </Border>
                    <Border Width="400" Background="Blue" BorderBrush="Black" BorderThickness="1">
                        <TextBlock Foreground="black" FontSize="14">Stacked Item #2</TextBlock>
                    </Border>
                    <Border Background="Yellow" BorderBrush="Black" BorderThickness="1">
                        <TextBlock Foreground="black" FontSize="16">Stacked Item #3</TextBlock>
                    </Border>
                    <Border Width="200" Background="Green" BorderBrush="Black" BorderThickness="1">
                        <TextBlock Foreground="black" FontSize="18">Stacked Item #4</TextBlock>
                    </Border>
                    <Border Background="White" BorderBrush="Black" BorderThickness="1">
                        <TextBlock Foreground="black" FontSize="20">Stacked Item #5</TextBlock>
                    </Border>
                </StackPanel>
            </TabItem>
        </TabControl>

    </StackPanel>

</Page>

   
    
    
    
  








Related examples in the same category

1.Stretch = Uniform
2.Stretch = UniformToFill
3.Stretch = FillStretch = Fill
4.Stretch = NoneStretch = None
5.Simple StackPanelSimple StackPanel
6.Set height, Background and Orientation for StackPanelSet height, Background and Orientation for StackPanel
7.Change StackPanel OrientationChange StackPanel Orientation
8.Use the methods that are defined by the IScrollInfo interface to scroll the child content of a StackPanel.Use the methods that are defined by the IScrollInfo interface to scroll the child content of a StackPanel.
9.Use StackPanel to arrange child objects in a single line that you can align horizontally or vertically.Use StackPanel to arrange child objects in a single line that you can align horizontally or vertically.