سلام بر تمامی برنامه نویسان عزیز 😉 در این مطلب از وب سایت پروگرم 98 کد DockPanel با TextBlock با wpf و #C را آماده کردم. انشاالله که این آموزش برای شما مفید باشد.
تصاویر خروجی نهایی این کد:
کد DockPanel با TextBlock با wpf و #C :
<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">
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">