Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I align side by side in stackpanel?

How can I have the button align beside the ComboBox ? I am not able to drag the button to the side of the ComboBox using designer.

<Expander.Content>
    <StackPanel>
        <ComboBox Name="cbProd" Height="30" IsEditable="True" FontSize="15" />
        <Button Name="btnAdd" Content="add" Click="btnAddProduct_Click" />
like image 923
Alvin Avatar asked Sep 26 '12 07:09

Alvin


1 Answers

Just nest multiple layout containers like this:

<Expander.Content>
    <StackPanel Orientation="Vertical">
        <StackPanel Orientation="Horizontal">
            <ComboBox Name="cbProd" Height="30" IsEditable="True" FontSize="15" />
            <Button Name="btnAdd" Content="add" Click="btnAddProduct_Click" />
        </StackPanel>
        ... your other controls
    </StackPanel>
</Expander.Content>
like image 168
SvenG Avatar answered Sep 19 '22 14:09

SvenG