Arranging controls vertically
Pages often contain many controls that must be arranged in some way. One of the most natural ways is arranging them vertically, one below another. This linear method is supported by the StackPanel
control. In this recipe, you will learn how to use it to prepare the page with a registration form consisting of a few other controls, namely TextBlock
, TextBox
, PasswordBox
, ComboBox
, CheckBox
, and Button
.
Getting ready
To step through this recipe, you only need the automatically generated project.
How to do it...
To arrange controls vertically to create a simple registration form, modify the content of the MainPage.xaml
file as follows:
<Page (...)>
<StackPanel Background="White" Padding="20">
<TextBlock
Text="Create an account"
FontSize="26"
Margin="0 0 0 20" />
<TextBox
Header="Login"
...