Skybound AutoComplete

MeasureItemEventArgs.MeasureText Method (String)

Measures the dimensions of a given string.

[Visual Basic]
Overloads Public Function MeasureText( _
   ByVal text As String _
) As Size
[C#]
public Size MeasureText(
   string text
);

Parameters

text
The string to measure.

Return Value

A Size structure that represents the dimensions of the text.

Remarks

This method measures the dimensions of text as it would be drawn on the graphics surface.

MeasureText uses GDI to measure, whereas Graphics.MeasureString uses GDI+). DrawText also uses GDI, so if you use DrawText, be sure to use MeasureText to measure, since GDI and GDI+ will return different dimensions for the same text.

See Also

MeasureItemEventArgs Class | Skybound.AutoComplete Namespace | MeasureItemEventArgs.MeasureText Overload List