CONTROLS OVERVIEW

You can group WPF controls into several categories. Some of these correspond naturally to the purposes of Windows Forms controls. Other categories play a more important role in WPF than they do in Windows Forms applications.

In particular, WPF controls rely heavily on layout controls that arrange and organize the controls that they contain. Windows Forms developers often simply arrange controls on a form with fixed sizes and positions. A WPF application is more likely to arrange the controls in a hierarchy of StackPanel and Grid controls and let those controls arrange their contents.

The recent proliferation of screen formats makes this idea more important than ever. If you write programs running on everything from traditional desktop systems to Windows 8 tablets, your programs will need the ability to rearrange their controls automatically. A smartphone can even switch from portrait to landscape orientation while a program is running, so the program must respond to make effective use of the available space. I won’t claim that most applications should be able to run on a tiny phone screen or a 17″ laptop without any changes, but good use of container controls can simplify some of the changes you’ll need to make.

The following sections describe the main categories of WPF controls. The example programs for this chapter, which are available on the book’s website, demonstrate many of the controls’ basic uses.

CONCEALED CONTROLS
Not all of the controls described ...

Get Visual Basic 2012 Programmer's Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.