For that reason, be careful not to overuse it.
Fonts
The Control class defines a small set of font-related properties that determine how text
appears in a control. These properties are outlined in Table 7-1.
nNote The Control class doesn??™t define any properties that use its font. While many controls include a
property such as Text, it isn??™t defined as part of the base control class. Obviously, the font properties don??™t
mean anything unless they??™re used by the derived class.
Table 7-1. Font-Related Properties of the Control Class
Name Description
FontFamily The name of the font you want to use.
FontSize The size of the font in device-independent units (each of which is 1/96 of an
inch). This is a bit of a change from tradition that??™s designed to support WPF??™s
new resolution-independent rendering model. Ordinary Windows applications
measure fonts using points, which are assumed to be 1/72 of an inch on a
standard PC monitor. If you want to turn a WPF font size into a more familiar
point size, you can use a handy trick??”just multiply by 3/4. For example, a
traditional 38-point is equivalent to 48 units in WPF.
CHAPTER 7 n CLASSIC CONTROLS 188
CHAPTER 7 n CLASSIC CONTROLS 189
Name Description
FontStyle The angling of the text, as represented as a FontStyle object. You get the
FontSyle preset you need from the shared properties of the FontStyles class,
which includes Normal, Italic, or Oblique lettering.
Pages:
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367