Another task that is frequently performed in applications is entering different types of information, such as a first or last name, an e-mail address, or a phone number. You could easily allow a user to type a text using the TextBox
control. In this recipe, you will learn how to place it on the page, modify its appearance, as well as handle events related to typing data within such a control.
To add a textbox and handle some of its events, perform the following steps:
Place the
TextBox
control on the page and adjust its appearance by modifying the content of theMainPage.xaml
file as follows:<Page (...)> <Grid (...)> <TextBox PlaceholderText="Type a first name..." BorderBrush="#4a4a4a" BorderThickness="3" ...