In The Hand LtdIn The Hand
MeasureString Method (g, text, font, layoutArea, stringFormat)
NamespacesInTheHand.DrawingGraphicsHelperMeasureString(Graphics, String, Font, SizeF, StringFormat)
.NET Components for Mobility
Measures the specified string when drawn with the specified Font and formatted with the specified StringFormat.
Declaration Syntax
C#Visual Basic
public static SizeF MeasureString(
	Graphics g,
	string text,
	Font font,
	SizeF layoutArea,
	StringFormat stringFormat
)
Public Shared Function MeasureString ( _
	g As Graphics, _
	text As String, _
	font As Font, _
	layoutArea As SizeF, _
	stringFormat As StringFormat _
) As SizeF
Parameters
g (Graphics)
Graphics instance.
text (String)
String to measure.
font (Font)
Font defines the text format of the string.
layoutArea (SizeF)
SizeF structure that specifies the maximum layout area for the text.
stringFormat (StringFormat)
StringFormat that represents formatting information, such as line spacing, for the string.
Return Value
This method returns a SizeF structure that represents the size, in the units specified by the PageUnit property, of the string specified by the text parameter as drawn with the font parameter.

Assembly: InTheHand.Drawing (Module: InTheHand.Drawing) Version: 7.0.0.0