Export (0) Print
Expand All

VisualStyleRenderer.DrawText Method (IDeviceContext, Rectangle, String, Boolean, TextFormatFlags)

Draws text in the specified bounding rectangle with the option of displaying disabled text and applying other text formatting.

Namespace:  System.Windows.Forms.VisualStyles
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public void DrawText(
	IDeviceContext dc,
	Rectangle bounds,
	string textToDraw,
	bool drawDisabled,
	TextFormatFlags flags
)

Parameters

dc
Type: System.Drawing.IDeviceContext

The IDeviceContext used to draw the text.

bounds
Type: System.Drawing.Rectangle

A Rectangle in which to draw the text.

textToDraw
Type: System.String

The text to draw.

drawDisabled
Type: System.Boolean

true to draw grayed-out text; otherwise, false.

flags
Type: System.Windows.Forms.TextFormatFlags

A bitwise combination of the TextFormatFlags values.

ExceptionCondition
ArgumentNullException

dc is null.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft