Controls
Windows applications present a graphical interface that users
interact with. Most users are familiar with certain common GUI features. For
example, they recognize buttons as things that can be clicked, and they know
that they can type into text boxes. These features are often made up of many
individual visual pieces. For example, a text box consists of an outlined
rectangle, a sequence of characters representing the text, and a blinking
vertical line showing where the next character will appear. Users recognize
that these parts form a single entity that offers certain functionality. In
WPF, such composite entities are called controls .
There are many ways to alter the appearance of a control. We can
adjust properties to make simple alterations, such as setting foreground and
background colors. With controls that support the content model, we can put any
mixture of graphics and text inside the control. We can even using templates to
replace the whole look of the control. However, even if we replace the visuals
of, say, a scrollbar, we have not changed its fundamental role as an element
for performing scrolling. In WPF, it is this behavior that forms the essence of
a control.
In this chapter we will examine how to use controls to handle
input, and we will explore the set of behaviors offered by the built-in
controls.
 |