Hi!
You cannot calculate exact size. This because each letter in font have its own width. For example, string 'III' have less width than 'WWW'. Thus, you can calculate exactly only average width of control or maximum width.
>Thanks, Martín and Vlad.
>
>Martín :
> I can't see the file ("GenRepoX"), it gives a error if i trie to download.
>
>Vlad:
> Thanks, for the tip, but at this point, but i need the EXACT formula to calculate the size of the Field in "Fox Report".
>
>See the example:
>
> Font | Form | Report | My Formula
>---------------+--------+------------+-----------------
>Arial 4 | 8 | 625.000 | 625.000 |
> 9 | 17 | 1562.500 | 1562.500 |
> 18 | 29 | 2916.667 | 2916.667 |
> 24 | 38 | 3854.167 | 3750.000 | ????
>
>The Values from de "FORM" and "REPORT" was given by de VisualFoxPro
>I get a formula that gives the correct result for ALLMOST sizes and Fonts
>
>---------------------------------------------------------------------------
>Function GetTextHeight
>Parameter tcFontName, tnFontSize
> #define g_RptConverteFACTOR 104.166666666667
>
>Local lnSize
>lnSize = FONTMETRIC(1, tcFontName, tnFontSize)
>lnSize = Round(lnSize * g_RptConverteFACTOR, 3)
>Return lnSize
>---------------------------------------------------------------------------
>
>Nuno Brito
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.comICQ #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.