Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Hot keys for buttons
Message
From
10/06/2002 06:03:39
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00665597
Message ID:
00666454
Views:
23
This message has been marked as a message which has helped to the initial question of the thread.
Hi Sebastian,

PMFJI,
The gap on height is some extra space around the first and last line.
In Thread#621982 Message#622409 I found a way to calculate this gap. This is for an editbox but should work for Listbox also.

Agnes
>Hi, Nadya!
>
>>>
>I was trying to use FontSize, but it's in points, and form's height in pixels. I sent this form to your e-mail address (clicked on envelope).
><<
>
>That's not a big deal - I dealed with those stuff at my 2.6 time a lot:
>To calculate with the metrics of a font - you have to use the FONTMETRIC() function!
>
>For the height of a line use
lnHeight = FONTMETRIC( 1, cFontName, nFontSize , cFontStyle ) ;
>            + FONTMETRIC( 5, cFontName, nFontSize , cFontStyle )
>For the width use
lnWidth = TXTWIDTH( m.MyText, cFontName, nFontSize , cFontStyle ) ;
>            * FONTMETRIC( 6, cFontName, nFontSize , cFontStyle )
NOTE: Do never forget to specify all font parameters!
>
>BTW: FONTMETRIC( 5,...) is zero for a lot of fonts, but for some fonts not (this is an additional offset below the normal row of the characters!).
>
>NOTE: May be you have to add an another additional offset which is given due to a listbox specific gap between the lines. Make a screen shot, zoom it using Paint.exe to 800% and find it out <vbg>!
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform