

Using (Font font1 = new Font("Arial", 12, FontStyle.Bold, GraphicsUnit.Point)) string text1 = "Use StringFormat and Rectangle objects to" Use a StringFormat with the appropriate DrawString method to specify centered text. To draw centered text with GDI+ (DrawString) You can easily align text drawn with the DrawString or DrawText methods by creating the correct formatting object and setting the appropriate format flags.

When you perform custom drawing, you may often want to center drawn text on a form or control.
