Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calculate textbox width
Message
De
30/04/2003 08:06:12
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00783078
Message ID:
00783100
Vues:
11
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform