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

Arranging controls in a grid

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).

Getting ready

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

How to do it...

To create a simple calculator demonstrating ...

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