This documentation is archived and is not being maintained.
Using Fonts and Text
Visual Studio 2010
There are several classes offered by GDI+ and GDI for drawing text on Windows Forms. The GDI+ Graphics class has several DrawString methods that allow you to specify various features of text, such as location, bounding rectangle, font, and format. In addition, you can draw and measure text with GDI using the static DrawText and MeasureText methods offered by the TextRenderer class. The GDI methods also allow you to specify location, font, and format. You can choose either GDI or GDI+ for text rendering; however, GDI generally offers better performance and more accurate text measuring. Other classes that contribute to text rendering include FontFamily, Font, StringFormat, and TextFormatFlags.
Show: