Version

CalcSize(Control,AppearanceData,Int32,DefaultableBoolean) Method

Calculates the size necessary to fully display this formatted text.
Syntax
'Declaration
 
Public Overloads Function CalcSize( _
   ByVal control As Control, _
   ByRef defaultAppearance As AppearanceData, _
   ByVal widthConstraint As Integer, _
   ByVal wrapText As DefaultableBoolean _
) As Size

Parameters

control
Control that provides the base font and graphics object.
defaultAppearance
Default appearance. This is the appearance of parent element that will be hosting the formatted text element since appearances are inherited.
widthConstraint
The width constraint. Value of 0 means no width constraint. Note that the returned size can be bigger than the width constraint if formatted text value is as such that it requires larger area than the width constraint. For example, an image in formatted text could constraint the required minimum width necessary to display the formatted text.
wrapText
Specifies whether the formatted text is going to be rendered with wrapping enabled or disabled.

Return Value

Returns the calculated size.
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also