-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Windows Application Development Cookbook
By :
The arrangement of controls in a linear way is not the only possible option. You can also arrange controls in a grid by specifying in which rows and columns each control should be located. What is interesting is that the available solution gives developers a lot of flexibility, such as defining the width of columns and the height of rows. In this recipe, you will learn how to define a grid and arrange controls within it.
As an example, you will design a simple calculator with TextBlock for the results and 16 Button controls (with 0-9 digits, +, -, *, /, =, and a comma).
To step through this recipe, you only need the automatically generated project.
To create a simple calculator demonstrating arrangement of controls in a grid, you need to perform the following steps:
Specify styles for Button and TextBlock controls. Do this by modifying the content of the MainPage.xaml file as follows:
<Page (...)>
<Page...