When you want to add elements in a stack fashion, either horizontally or vertically, you need to use the StackPanel. You need to specify the Orientation property to set whether it will be a horizontal stack panel or a vertical stack panel. The following figure demonstrates a horizontal and a vertical StackPanel:
![](/api/v2/epubs/9781787281905/files/assets/9333b94a-b263-4be1-b386-c1b64a4f5d53.png)
If you don't specify any orientation, it will by default be set as a vertical stack panel. You can add multiple UI elements (controls or panels) as children to it:
<!-- Horizontal StackPanel --> <StackPanel Orientation="Horizontal"> <TextBlock Text="Stack 1"/> <TextBlock Text="Stack 2"/> ...