O'Reilly logo

Windows Application Development Cookbook by Marcin Jamro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding a textbox

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.

Getting ready

To step through this recipe, you only need the automatically generated project.

How to do it...

To add a textbox and handle some of its events, perform the following steps:

  1. Place the TextBox control on the page and adjust its appearance by modifying the content of the MainPage.xaml file as follows:
            <Page (...)> 
                <Grid (...)> 
                    <TextBox ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required