How to: Draw Text with GDI
With the DrawText method in the TextRenderer class, you can access GDI functionality for drawing text on a form or control. GDI text rendering typically offers better performance and more accurate text measuring than GDI+.
The following code example demonstrates how to draw text on multiple lines within a rectangle using the DrawText method.
To render text with the TextRenderer class, you need an IDeviceContext, such as a Graphics and a Font, a location to draw the text, and the color in which it should be drawn. Optionally, you can specify the text formatting by using the TextFormatFlags enumeration.