VisualStyleRenderer.GetTextExtent VisualStyleRenderer.GetTextExtent VisualStyleRenderer.GetTextExtent VisualStyleRenderer.GetTextExtent Method

Definition

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

Overloads

GetTextExtent(IDeviceContext, String, TextFormatFlags) GetTextExtent(IDeviceContext, String, TextFormatFlags) GetTextExtent(IDeviceContext, String, TextFormatFlags) GetTextExtent(IDeviceContext, String, TextFormatFlags)

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

GetTextExtent(IDeviceContext, Rectangle, String, TextFormatFlags) GetTextExtent(IDeviceContext, Rectangle, String, TextFormatFlags) GetTextExtent(IDeviceContext, Rectangle, String, TextFormatFlags) GetTextExtent(IDeviceContext, Rectangle, String, TextFormatFlags)

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.

GetTextExtent(IDeviceContext, String, TextFormatFlags) GetTextExtent(IDeviceContext, String, TextFormatFlags) GetTextExtent(IDeviceContext, String, TextFormatFlags) GetTextExtent(IDeviceContext, String, TextFormatFlags)

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

public:
 System::Drawing::Rectangle GetTextExtent(System::Drawing::IDeviceContext ^ dc, System::String ^ textToDraw, System::Windows::Forms::TextFormatFlags flags);
public System.Drawing.Rectangle GetTextExtent (System.Drawing.IDeviceContext dc, string textToDraw, System.Windows.Forms.TextFormatFlags flags);
member this.GetTextExtent : System.Drawing.IDeviceContext * string * System.Windows.Forms.TextFormatFlags -> System.Drawing.Rectangle
Public Function GetTextExtent (dc As IDeviceContext, textToDraw As String, flags As TextFormatFlags) As Rectangle

Parameters

textToDraw
String String String String

The string to measure.

Returns

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

Exceptions

GetTextExtent(IDeviceContext, Rectangle, String, TextFormatFlags) GetTextExtent(IDeviceContext, Rectangle, String, TextFormatFlags) GetTextExtent(IDeviceContext, Rectangle, String, TextFormatFlags) GetTextExtent(IDeviceContext, Rectangle, String, TextFormatFlags)

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.

public:
 System::Drawing::Rectangle GetTextExtent(System::Drawing::IDeviceContext ^ dc, System::Drawing::Rectangle bounds, System::String ^ textToDraw, System::Windows::Forms::TextFormatFlags flags);
public System.Drawing.Rectangle GetTextExtent (System.Drawing.IDeviceContext dc, System.Drawing.Rectangle bounds, string textToDraw, System.Windows.Forms.TextFormatFlags flags);
member this.GetTextExtent : System.Drawing.IDeviceContext * System.Drawing.Rectangle * string * System.Windows.Forms.TextFormatFlags -> System.Drawing.Rectangle
Public Function GetTextExtent (dc As IDeviceContext, bounds As Rectangle, textToDraw As String, flags As TextFormatFlags) As Rectangle

Parameters

bounds
Rectangle Rectangle Rectangle Rectangle

A Rectangle used to control the flow and wrapping of the text.

textToDraw
String String String String

The string to measure.

Returns

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

Exceptions

Applies to