lnLength = *length of the field* 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) endwithYou'll note the use of a couple of "magical" numbers: "6" and "2". "6" is the number of pixels added to the width of a 3-D textbox (3 pixels left + 3 pixels right). "2" was determined empirically (TXTWIDTH * FONTMETRIC(6) seems to be out by 2 pixels on average).