Text

Text has two different components. The first is the content (the actual characters contained in the text string). The content typically consists of ASCII or Unicode characters entered in one of several ways:

  • Directly from the keyboard.

  • From the keyboard using the Alt key and a four-digit ASCII or Unicode decimal value.

  • Programmatically. (In C#, cast an ASCII or Unicode value to a character type [(char) n, where n is a decimal ASCII or Unicode value] or, in VB.NET, use a function such as Chr( ))

The second component of text is the format or appearance. This component is defined by the font, which dictates how the characters look. There are many different fonts, such as Times New Roman and Arial. In addition, most fonts can have style attributes applied, such as bold or italic.

Tip

Text and fonts are covered thoroughly in Chapter 9.

Get Programming .NET Windows Applications 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.