my problem is how to create a docking panel on Windows Presentation Foundation c# ? I don't know a call it is docking panel is true or false, because some documents call like that. but it like toolbox, server explorer in visual studio. i searched so many documents but there are nothing, every thing are generality to show the view. I want to know how to code to create it. I'm sorry first because i had a stupid question. So can i help me do that ? or have some documents can help me ? Thank !
Asked
Active
Viewed 433 times
1 Answers
0
You can create your docking panel in the xaml code by calling DockPanel, then you set the property lastchildfill to true so that the order of created elements will determine how they behave and will define their position in the window, as shown in code bellow.
<Grid>
<DockPanel LastChildFill="True">
<StackPanel DockPanel.Dock="Left" Width="50" HorizontalAlignment="Left" Background="Aqua">
<Label Content="1" HorizontalAlignment="Center"/>
</StackPanel>
<StackPanel DockPanel.Dock="Top" Background="Beige" Height="50">
<Label Content="2" HorizontalAlignment="Center"/>
</StackPanel>
<StackPanel DockPanel.Dock="Bottom" Background="Red" Height="100">
<Label Content="3" HorizontalAlignment="Center"/>
</StackPanel>
<StackPanel DockPanel.Dock="Right" Background="Yellow" Width="100">
<Label Content="4" HorizontalAlignment="Center"/>
</StackPanel>[![enter image description here][1]][1]
<StackPanel DockPanel.Dock="Bottom" Background="Gray" Height="50">
<Label Content="5" HorizontalAlignment="Center"/>
[![enter image description here][1]][1]</StackPanel>
<StackPanel DockPanel.Dock="Right" Background="Black" Width="50">
<Label Content="6" HorizontalAlignment="Center" Background="White"/>
</StackPanel>
</DockPanel>
</Grid>

Saber CHETIOUI
- 50
- 1
- 13