Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Font and Field Size
Message
 
 
À
09/01/2001 13:38:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00461331
Message ID:
00461356
Vues:
11
Hi!

There is nice function - TxtWidth(). It allows to calculate the size of text by font and font size. For field, get the field size and replicate it with character that have average width:

TxtWidth(replicate('A',FieldSize),'Arial','12')

Above function returns required width for character fields. Of course, when you use 'W' instead of 'A', for most fonts above function will return larger number. For numeric fields replace 'A' by '8'.

There is also FONTMETRIC( ) function, you can give it a use too.

>hi, Can anyone help me with my little problem ....
>
> I'm doing a "Report Designer" and i need to know the size (height and width) to any field to a report field.
>
> The user can say the Font and Size, and the program automatic put the field in the correct size on the report.
>
>
>Nuno Brito
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform