ich glaube die function ist etwas besser geeignet, da flexgid unterschiedliche font eigenschaften hat.
Friend Function TextCalRect(ByVal Font As IFont, ByVal Flag&, ByVal lWidth&, ByVal Tx As Variant, _
Optional ByVal sFormat$, Optional lHeight&, Optional ByVal bSetWidth As Boolean = True) As RECT
Dim thFnt&, t$, hFnt&, w&
If Font Is Nothing Then hFnt = m_hFntDefault Else hFnt = Font.hFont
If sFormat = „“ Then t = Tx Else t = Format(Tx, sFormat)
thFnt = SelectObject(m_hdc, hFnt)
With TextCalRect
.Right = lWidth
lHeight = (2 * ewTx) + DrawText(m_hdc, t, -1, TextCalRect, Flag Or EditCal)
If bSetWidth Then .Right = lWidth
End With
SelectObject m_hdc, thFnt
End Function
allso pussle dir was passendes zusammen, kann ja nun nicht mehr allso schwer sein.
volker