Tools

Namespaces

Variants

Views

Actions

Search

Contents

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Create a project with any name of your choice ('''ContentControl''' in this example) and place a button in the mainPage.xaml file. As soon as you place the button you will see the ''MainPage.xaml'' will change to code much like the following.

+

Create a project with any name of your choice ('''ContentControl''' in this example) and place a button in the '''mainPage.xaml''' file. As soon as you place the button you will see the '''MainPage.xaml''' will change to code much like the following.

You can see in the designer view that the picture is now part of your button. We add a '''<TextBlock>''' below this image - using either the toolbox (drag'n'drop) or typing the xml code of TextBlock. After adding TextBlock your above code will look something like this.

+

You can see in the designer view that the picture is now part of your button. We add a {{Icode|TextBlock}} below this image - using either the toolbox (drag'n'drop) or typing the xml code of {{Icode|TextBlock}}. After adding {{Icode|TextBlock}} your above code will look something like this.

<code xml>

<code xml>

<Button HorizontalAlignment="Center" VerticalAlignment="Center" >

<Button HorizontalAlignment="Center" VerticalAlignment="Center" >

Latest revision as of 04:25, 5 October 2013

This article explains how to create a Button with an image and text in Windows Phone.

Create a project with any name of your choice (ContentControl in this example) and place a button in the mainPage.xaml file. As soon as you place the button you will see the MainPage.xaml will change to code much like the following.

You can see in the designer view that the picture is now part of your button. We add a TextBlock below this image - using either the toolbox (drag'n'drop) or typing the xml code of TextBlock. After adding TextBlock your above code will look something like this.