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

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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.

Exception Condition
ArgumentNullException

dc is null.

.NET Framework
Available since 2.0
Return to top
Show: