Information générale
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Calculating widths and heights of strings
I'm creating a form programatically and want to calculate the correct values for width and height. Up to now I've been approximating with:
replace width with 70*(fontsize*(LEN(expr)) )
As an example, I have a label with a value of "Length of time in this position", Font:Arial Narrow - 8 point - I make the width to be 18480, but if I open the form in Designer it gets changed to 12291.667
The value of FONTMETRIC(7,'Arial Narrow',8) is 13 pixels, the length of the string is 31.
How do I use these values to get 12291.667?
The other thing is that the height that I create for the label string is too small, and on the screen it appears to truncate descending characters, yet when I print the form it's ok.
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement