DockPanel with TextBlock : DockPanel « Windows Presentation Foundation « C# / C Sharp






DockPanel with TextBlock

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

    <StackPanel>
        <TabControl MinHeight="500" MinWidth="400">
            <TabItem Header="DockPanel" IsSelected="true">
                <DockPanel>
                    <Border Height="25" Background="Red" BorderBrush="Black" BorderThickness="1" DockPanel.Dock="Top">
                        <TextBlock Foreground="black">Dock = "Top"</TextBlock>
                    </Border>
                    <Border Height="25" Background="Blue" BorderBrush="Black" BorderThickness="1" DockPanel.Dock="Top">
                        <TextBlock Foreground="black">Dock = "Top"</TextBlock>
                    </Border>
                    <Border Height="25" Background="Black" BorderBrush="Black" BorderThickness="1" DockPanel.Dock="Bottom">
                        <TextBlock Foreground="black">Dock = "Bottom"</TextBlock>
                    </Border>
                    <Border Width="200" Background="PaleGreen" BorderBrush="Black" BorderThickness="1" DockPanel.Dock="Left">
                        <TextBlock Foreground="black">Dock = "Left"</TextBlock>
                    </Border>
                    <Border Background="White" BorderBrush="Black" BorderThickness="1">
                        <TextBlock Foreground="black">This content fills the remaining, unallocated space.</TextBlock>
                    </Border>
                </DockPanel>
            </TabItem>

        </TabControl>

    </StackPanel>

</Page>

   
    
    
    
    
    
  








Related examples in the same category

1.DockPanel and GridDockPanel and Grid
2.Put a Menu and toolbar on the top with DockPanelPut a Menu and toolbar on the top with DockPanel
3.Put a simple StatusBar on the bottom with DockPanelPut a simple StatusBar on the bottom with DockPanel
4.DockPanel FillDockPanel Fill
5.DockPanel with Menu, ToolBarTray, StatusBar, StackPanelDockPanel with Menu, ToolBarTray, StatusBar, StackPanel
6.LayoutPanels Basic Dialog BoxLayoutPanels Basic Dialog Box
7.Dock more than two objectsDock more than two objects
8.Docking left and right before top and bottomDocking left and right before top and bottom
9.Show the effect of each value of the Dock property by manipulating two Rectangle elements.Show the effect of each value of the Dock property by manipulating two Rectangle elements.