The StackPanel will stack the controls, so there is no short answer. This is not what the StackPanel is designed for.
You can use the grid as Vlad suggested. Something like that:
<Grid HorizontalAlignment="Stretch"> <Grid.ColumnDefinitions> <ColumnDefinition Width="auto"/> <ColumnDefinition Width="*"/> <ColumnDefinition Width="auto"/> <ColumnDefinition Width="*"/> <ColumnDefinition Width="auto"/> </Grid.ColumnDefinitions> <Button Width="20" Height="20" Grid.Column="0"/> <Button Width="20" Height="20" Grid.Column="2"/> <Button Width="20" Height="20" Grid.Column="4"/> </Grid>
Matt burland
source share