Answer the question
In order to leave comments, you need to log in
DockPanel issues - alignment not working?
<DockPanel Width="Auto" Height="Auto">
<Button DockPanel.Dock="Right" Width="50">dock 2.1</Button>
</DockPanel>
<DockPanel Name="DP1">
<Button DockPanel.Dock="Right" Width="50">dock 2.1</Button>
<Button DockPanel.Dock="Right" Width="50">dock 2.1</Button>
</DockPanel>
Answer the question
In order to leave comments, you need to log in
Add the LastChildFill property:
<DockPanel LastChildFill="False">
<Button DockPanel.Dock="Right" Width="50">dock 2.1</Button>
</DockPanel>
This happens because there is no element occupying the free space. You can do it in two ways:
either add some kind of container:
<DockPanel Height="Auto">
<Button DockPanel.Dock="Right" Width="50">dock 2.1</Button>
<Grid>
</Grid>
</DockPanel>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question