Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Precise width in pixel of a String
Message
From
27/05/1997 09:16:39
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00033669
Message ID:
00033675
Views:
36
>Hi,
>
>I want to determine the precise width in pixel of a string.
>In my Grid class, I want to optimize the space of the columns
>without cutting the header's caption
>
>I use the max(len..)) approach with Transform for the Inputmask
>that gave me the correct caracter length but is there a way to determine the pixel length.
>
>Exemple.
>column: "123 456" = 7 car. * fontsize(9) = 69 but can fit in 60 pixels
>
>The caption header is in bold
>Header: "test" = 4 car. * fontsize(9)+1 = 40
> ^--Bold
>
>Steve,
>Thanks in advance for you suggestions

You can calculate precize pixel length using FONTMETRIC(), but just for proportional font.
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform