Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calculate textbox width
Message
From
30/04/2003 08:06:12
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00783078
Message ID:
00783100
Views:
12
>Hello all,
>does anyone know the formula to calculate a textbox width and the like, based on the font,fontsize number of characters etc..., my client ( quite rightly ) only wants to display the exact number of storable characters.
>
>regards
>
>Peter Kane

Peter,

You'll have to adjust a bit. I am still half a char short
local FontBold, FontItalic, FontName, FontSize, FontUnderline

FontBold		= thisform.FontBold
FontItalic		= thisform.FontItalic
FontName		= thisform.FontName
FontSize		= thisform.FontSize
FontUnderline	        = thisform.FontUnderline

thisform.FontBold		= this.FontBold
thisform.FontItalic		= this.FontItalic
thisform.FontName		= this.FontName
thisform.FontSize		= this.FontSize
thisform.FontUnderline	        = this.FontUnderline

this.Width = thisform.TextWidth(rtrim(this.Value)) + 2 * this.Margin


thisform.FontBold		= FontBold
thisform.FontItalic		= FontItalic
thisform.FontName		= FontName
thisform.FontSize		= FontSize
thisform.FontUnderline	        = FontUnderline
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform