Chapter 5. The Grid panel

 

This chapter covers:

  • The Grid layout
  • Localizing with the Grid
  • The UniformGrid
  • Turning your $2000 computer into a $5 pocket calculator

So far we’ve spent a lot of time talking about all the different layout controls available—except the one that you’re likely to use much of the time! The Grid panel control is the most powerful and, except for the Canvas which has no real rules, the most flexible. The Grid can be used to emulate the behavior of many of the other layout options, but it’s easier to use the more appropriate layout panel.

Aside from being the default layout used by Visual Studio, the Grid is a good layout for things like dialogs with a number of interactive controls (text boxes, radio buttons, and so on). The Grid panel can also behave like a Canvas “explicit position” control with pseudo-docking abilities—although using the Grid in this way loses some of the advantages of layout.

5.1. Getting started with the Grid layout panel

5.2. Using the Grid layout to build a calculator UI

5.3. The Grid and localization

5.4. UniformGrid

5.5. Making the calculator work

5.6. Summary

sitemap