Unicode Controls & Classes for VB6 - Version 4

clsCommonWrapper.CalculateTextRectSize Method

Calculates the size of a string in a given rectangle, always uses [eCtlDrawTextFormat].CTL_DT_CALCRECT and [eCtlDrawTextFormat].CTL_DT_WORDBREAK flags

Syntax
Public Sub CalculateTextRectSize (ByVal lHdc As Long, _
ByRef sText As String, _
ByVal X1 As Long, _
ByVal y1 As Long, _
ByVal X2 As Long, _
ByVal y2 As Long, _
ByVal lAdditionalFlags As Long, _
ByRef retWDim As Long, _
ByRef retHDim As Long)
Parameters
Parameter Description
ByVal lHdc As Long The destination Device Context
ByRef sText As String The source string to measure
ByVal X1 As Long The Left rectangle coordinate
ByVal y1 As Long The Top rectangle coordinate
ByVal X2 As Long The Right rectangle coordinate
ByVal y2 As Long The Bottom rectangle coordinate
ByVal lAdditionalFlags As Long A combination of [eCtlDrawTextFormat] flags
ByRef retWDim As Long Resulting Width in pixels
ByRef retHDim As Long Resulting Height in pixels
Remarks
moCW.CalculateTextRectSize lHdcDest, sText, 0, 0, 1, 1, 0, wBox, hBox