System.Windows.Forms.VisualStyles.VisualStyleRenderer.GetTextExtent Method

Returns the size and location of the specified string when drawn with the font of the current visual style element within the specified initial bounding rectangle.

Syntax

public System.Drawing.Rectangle GetTextExtent (System.Drawing.IDeviceContext dc, System.Drawing.Rectangle bounds, string textToDraw, System.Windows.Forms.TextFormatFlags flags)

Parameters

dc
The System.Drawing.IDeviceContext this operation will use.
bounds
A System.Drawing.Rectangle used to control the flow and wrapping of the text.
textToDraw
The string to measure.
flags
A bitwise combination of the System.Windows.Forms.TextFormatFlags values.

Returns

A System.Drawing.Rectangle that contains the area required to fit the rendered text.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: System.Windows.Forms.VisualStyles
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0