Text and Fonts

In a GUI environment such as Windows, displaying text is just another kind of graphical operation. In place of using pens and brushes as our drawing tool, we use fonts. Fonts are quite complicated and beyond the scope of this chapter to discuss in any detail. In fact, drawing with text using GDI+ is quite complicated, and normally you won't need to do that unless you are writing a rather specialized application such as a word processor. Normally, you will work with text data using the rich array of Windows controls.

We illustrate the fundamentals of working with text and fonts with the TextDemo program, which also demonstrates handling a KeyPress event for entering a character. The program allows you to type text, which is displayed ...

Get Application Development Using Visual Basic® and .NET 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.