lnLength = len(This.Value) with This lcStyle = iif(.FontBold, 'B', '') + iif(.FontItalic, 'I', '') + ; iif(.FontCondense, 'C', '') + iif(.FontExtend, 'E', '') + ; iif(.FontOutline, 'O', '') + iif(.FontShadow, 'S', '') + ; iif(.FontStrikethru, '-', '') + iif(.FontUnderline, 'U', '') lcStyle = iif(empty(lcStyle), 'N', lcStyle) .Width = min(txtwidth(replicate('W', lnLength), .FontName, ; .FontSize, lcStyle) * fontmetric(6, .FontName, .FontSize, ; lcStyle) + .Margin * 2 + iif(.SpecialEffect = 0, ; 6, 0) + 2, Thisform.Width - .Left - 5) endwith