Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calculating length of printed string.
Message
 
À
16/01/2000 18:24:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00318779
Message ID:
00318809
Vues:
27
>>Let's say the font is Arial Normal 8 and FONTMETRIC(6), the average width, is 5 pixels. Leaving out TXTMETRIC() to make the example simple, let's say all of the characters in the string are "average".
>
>I don't know the answer to what your asking, but I have a little trick to get the real length of a string in screen pixels. Add a label to a form, set its top to -100 and its Font and Size to whatever your measuring, and its caption to the string. Then Set its AutoSize to .T. and just read the length.


Mike,
the last time I tried that it wouldn't work unless the form was within the actual boundries of the screen. If it was off the screen it didn't get refreshed. I had to create a modless form with the text box behind my working form. I may have been using VFP 5.0 at the time. I now use 6.0.
Beer is proof that God loves man, and wants him to be happy. - Benjamin Franklin
John J. Henn
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform