Draws the specified text at the specified location, using the specified device context, font, color, and back color.
- dc
- The device context in which to draw the text.
- text
- The text to draw.
- font
- The System.Drawing.Font to apply to the drawn text.
- pt
- The System.Drawing.Point that represents the upper-left corner of the drawn text.
- foreColor
- The System.Drawing.Color to apply to the drawn text.
- backColor
- The System.Drawing.Color to apply to the background area of the drawn text.
The backColor parameter is applied to the rectangular area containing the drawn text. If font, backcolor or forecolor is null or System.Drawing.Color.Empty, respectively; the erload:System.Windows.Forms.TextRenderer.DrawText method will draw the text in the font or color currently selected in the device context specified by dc. If forecolor is System.Drawing.Color.Transparent, the text will not be drawn.
You can manipulate how the text is drawn by using one of the TextRenderer.DrawText(System.Drawing.IDeviceContext, string, System.Drawing.Font, System.Drawing.Rectangle, System.Drawing.Color, TextFormatFlags) overloads that takes a System.Windows.Forms.TextFormatFlags parameter.
The text rendering offered by the System.Windows.Forms.TextRenderer class is based on GDI text rendering and is not supported for printing from Windows Forms. Instead, use the erload:System.Drawing.Graphics.DrawString methods of the System.Drawing.Graphics class.
The erload:System.Windows.Forms.TextRenderer.DrawText methods that specify a System.Drawing.Point as the upper-left corner of the drawn text do not render correctly on Windows 2000. If your application is intended for use on machines running Windows 2000, you should use one of the erload:System.Windows.Forms.TextRenderer.DrawText methods that specify a System.Drawing.Rectangle for the bounds of the drawn text.