Walter Meester
HoogkarspelPays-Bas
Information générale
Catégorie:
Codage, syntaxe et commandes
Eric,
>On my form, I have some captions.
>They are right-justified and their size is not fix.
>In the init of my form, I am loading the labels.captions
>
>Since the labels are right-justified, the new content of the labels is all screw up.
>I figure out that I could calculate the needed right position of the labels if I only knew how long is the current content and how long would be the new content in pixel. Is there a way to predict this according to the string, the size and the font ?
IMO you don't need the width of the caption if you set the alignment of the label to 1 - Right (Be sure that autosize is set off because it screws up your alignment after all)
In case you might want to calculate it after all you the following strategy:
WITH Label
.Width=TXTWIDTH(.Caption,.fontname,.fontsize)*FONTMETRIC(6,.fontname,.fontsize)
ENDWITH
Précédent
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