The previously described TextBox
control is great for entering various kinds of information. However, it is not a perfect solution for typing passwords. To handle this type of information, the PasswordBox
control is available. You will learn how to use it in this recipe.
To add a password box and handle the PasswordChanged
event, perform the following steps:
Place the
PasswordBox
control on the page and adjust its appearance by modifying the content of theMainPage.xaml
file as follows:<Page (...)> <Grid (...)> <PasswordBox PlaceholderText="Type a password..." VerticalAlignment="Center" HorizontalAlignment="Stretch" Margin="20" /> </Grid> </Page> ...