Reputation:
I was writing C# code in winforms. In winForms using this menu (in the picture) I make center several buttons. But I can not find out any way to make center some elements horizontally in WPF.
Upvotes: 0
Views: 82
Reputation: 366
Use the HorizontalAlignment property. For example:
<StackPanel Orientation="Horizontal" Height="50" HorizontalAlignment="Center">
<Button Width="50" Margin="5"></Button>
<Button Width="50" Margin="5"></Button>
<Button Width="50" Margin="5"></Button>
<Button Width="50" Margin="5"></Button>
</StackPanel>
Upvotes: 1